WordPress.org

Make WordPress Core

Ticket #18952: 18952.3.patch

File 18952.3.patch, 5.7 KB (added by SergeyBiryukov, 2 years ago)
  • wp-admin/admin-header.php

     
    5555                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 
    5656                'time':'<?php echo time() ?>' 
    5757        }, 
    58         ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 
     58        ajaxurl = '<?php echo wp_ajax_url(); ?>', 
    5959        pagenow = '<?php echo $current_screen->id; ?>', 
    6060        typenow = '<?php echo $current_screen->post_type; ?>', 
    6161        adminpage = '<?php echo $admin_body_class; ?>', 
  • wp-admin/includes/image-edit.php

     
    6767        <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" /> 
    6868 
    6969        <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap"> 
    70         <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url('admin-ajax.php'); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" /> 
     70        <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo wp_ajax_url(); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" /> 
    7171        </div> 
    7272 
    7373        <div class="imgedit-submit"> 
  • wp-admin/includes/media.php

     
    334334//<![CDATA[ 
    335335addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 
    336336var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'}; 
    337 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 
     337var ajaxurl = '<?php echo wp_ajax_url(); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 
    338338isRtl = <?php echo (int) is_rtl(); ?>; 
    339339//]]> 
    340340</script> 
  • wp-admin/includes/template.php

     
    13901390                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 
    13911391                'time':'<?php echo time() ?>' 
    13921392        }, 
    1393         ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 
     1393        ajaxurl = '<?php echo wp_ajax_url(); ?>', 
    13941394        pagenow = '<?php echo $current_screen->id; ?>', 
    13951395        typenow = '<?php echo $current_screen->post_type; ?>', 
    13961396        adminpage = '<?php echo $admin_body_class; ?>', 
  • wp-admin/press-this.php

     
    304304//<![CDATA[ 
    305305addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 
    306306var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'}; 
    307 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 
     307var ajaxurl = '<?php echo wp_ajax_url(); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 
    308308var photostorage = false; 
    309309//]]> 
    310310</script> 
  • wp-includes/class-wp-editor.php

     
    576576                } 
    577577 
    578578                if ( !is_admin() ) 
    579                         echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'; 
     579                        echo 'var ajaxurl = "' . wp_ajax_url() . '";'; 
    580580?> 
    581581        </script> 
    582582<?php 
  • wp-includes/link-template.php

     
    19741974} 
    19751975 
    19761976/** 
     1977 * Retrieve the relative url to admin-ajax.php (for proper work with IDN domains). 
     1978 * 
     1979 * @link http://bugs.jquery.com/ticket/8419 
     1980 * @package WordPress 
     1981 * @since 3.4.0 
     1982 * 
     1983 * @return string Relative admin-ajax.php url. 
     1984*/ 
     1985function wp_ajax_url() { 
     1986        return preg_replace( '#^http(s)?://[^/]*#', '', get_admin_url( null, 'admin-ajax.php' ) ); 
     1987} 
     1988 
     1989/** 
    19771990 * Retrieve the url to the includes directory. 
    19781991 * 
    19791992 * @package WordPress 
  • wp-includes/media.php

     
    10961096<script type="text/javascript"> 
    10971097/* <![CDATA[ */ 
    10981098        jQuery(document).ready(function($){ 
    1099                 $.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>"); 
     1099                $.get("<?php echo add_query_arg( array( 'action' => 'oembed-cache', 'post' => $post_ID ), wp_ajax_url() ); ?>"); 
    11001100        }); 
    11011101/* ]]> */ 
    11021102</script>