File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ Make sure your theme's `footer.php` file has `<?php wp_footer(); ?>` somewhere i
5858= Version 3.1.13 =
5959
6060* Fix setting sanitization bug. Props Alexander Concha (@xknown).
61+ * Don't encode shortcode contents on (un)trash. Props Andrew Ozz (@azaozz).
6162
6263= Version 3.1.12 =
6364
Original file line number Diff line number Diff line change @@ -406,13 +406,16 @@ function encode_shortcode_contents_slashed_noquickedit( $content ) {
406406 // In certain weird circumstances, the content gets run through "content_save_pre" twice
407407 // Keep track and don't allow this filter to be run twice
408408 // I couldn't easily figure out why this happens and didn't bother looking into it further as this works fine
409- if ( true == $ this ->content_save_pre_ran )
409+ if ( true == $ this ->content_save_pre_ran ) {
410410 return $ content ;
411+ }
411412 $ this ->content_save_pre_ran = true ;
412413
413414 // Post quick edits aren't decoded for display, so we don't need to encode them (again)
414- if ( ! empty ( $ _POST ) && !empty ( $ _POST ['action ' ] ) && 'inline-save ' == $ _POST ['action ' ] )
415+ // This also aborts for (un)trashing to avoid extra encoding.
416+ if ( empty ( $ _POST ) || ( ! empty ( $ _POST ['action ' ] ) && 'inline-save ' == $ _POST ['action ' ] ) ) {
415417 return $ content ;
418+ }
416419
417420 return $ this ->encode_shortcode_contents_slashed ( $ content );
418421 }
You can’t perform that action at this time.
0 commit comments