File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -6839,21 +6839,19 @@ function wp_post_preview_js() {
68396839 // Has to match the window name used in post_submit_meta_box().
68406840 $ name = 'wp-preview- ' . (int ) $ post ->ID ;
68416841
6842- ?>
6843- <script>
6844- ( function() {
6842+ $ js = '( function() {
68456843 var query = document.location.search;
68466844
6847- if ( query && query.indexOf( ' preview=true' ) !== -1 ) {
6848- window.name = ' <?php echo $ name; ?> ' ;
6845+ if ( query && query.indexOf( " preview=true" ) !== -1 ) {
6846+ window.name = " ' . $ name . ' " ;
68496847 }
68506848
68516849 if ( window.addEventListener ) {
6852- window.addEventListener( ' unload' , function() { window.name = '' ; }, false );
6850+ window.addEventListener( " unload" , function() { window.name = "" ; }, false );
68536851 }
6854- }());
6855- </script>
6856- <?php
6852+ }()); ' ;
6853+
6854+ wp_print_inline_script_tag ( $ js );
68576855}
68586856
68596857/**
You can’t perform that action at this time.
0 commit comments