WordPress.org

Make WordPress Core

Ticket #18952: 18952.patch

File 18952.patch, 6.1 KB (added by SergeyBiryukov, 3 years ago)
  • wp-admin/admin-header.php

     
    5454                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 
    5555                'time':'<?php echo time() ?>' 
    5656        }, 
    57         ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 
     57        ajaxurl = '<?php echo relative_admin_url('admin-ajax.php'); ?>', 
    5858        pagenow = '<?php echo $current_screen->id; ?>', 
    5959        typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 
    6060        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 relative_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); ?>" /> 
    7171        </div> 
    7272 
    7373        <div class="imgedit-submit"> 
  • wp-admin/includes/media.php

     
    328328//<![CDATA[ 
    329329addLoadEvent = 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();}}}; 
    330330var 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(); ?>'}; 
    331 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 
     331var ajaxurl = '<?php echo relative_admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup', 
    332332isRtl = <?php echo (int) is_rtl(); ?>; 
    333333//]]> 
    334334</script> 
  • wp-admin/includes/template.php

     
    13691369                'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 
    13701370                'time':'<?php echo time() ?>' 
    13711371        }, 
    1372         ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 
     1372        ajaxurl = '<?php echo relative_admin_url('admin-ajax.php'); ?>', 
    13731373        pagenow = '<?php echo $current_screen->id; ?>', 
    13741374        typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 
    13751375        adminpage = '<?php echo $admin_body_class; ?>', 
  • wp-admin/press-this.php

     
    295295//<![CDATA[ 
    296296addLoadEvent = 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();}}}; 
    297297var 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() ?>'}; 
    298 var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 
     298var ajaxurl = '<?php echo relative_admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>; 
    299299var photostorage = false; 
    300300//]]> 
    301301</script> 
  • wp-includes/class-wp-editor.php

     
    595595                } 
    596596 
    597597                if ( !is_admin() ) 
    598                         echo 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'; 
     598                        echo 'var ajaxurl = "' . relative_admin_url('admin-ajax.php') . '";'; 
    599599?> 
    600600        </script> 
    601601<?php 
  • wp-includes/link-template.php

     
    19551955} 
    19561956 
    19571957/** 
     1958 * Retrieve the relative url to the admin area for the current site. 
     1959 * 
     1960 * @package WordPress 
     1961 * @since 3.4.0 
     1962 * 
     1963 * @param string $path Optional path relative to the admin url. 
     1964 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. 
     1965 * @return string Relative admin url link with optional path appended. 
     1966*/ 
     1967function relative_admin_url( $path = '', $scheme = 'admin' ) { 
     1968        return preg_replace( '#^http(s)?://[^/]*#', '', get_admin_url(null, $path, $scheme) ); 
     1969} 
     1970 
     1971/** 
    19581972 * Retrieve the url to the admin area for a given site. 
    19591973 * 
    19601974 * @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 relative_admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post_ID ); ?>"); 
    11001100        }); 
    11011101/* ]]> */ 
    11021102</script>