Ticket #15289: 15289.1.diff

File 15289.1.diff, 2.4 KB (added by caesarsgrunt, 3 years ago)
  • wp-includes/default-constants.php

     
    126126         */ 
    127127        if ( !defined( 'MUPLUGINDIR' ) ) 
    128128                define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH.  For back compat. 
     129 
     130        /** 
     131         * Allows for a different path to be used to access the wp-admin directory, without renaming the directory. 
     132         * 
     133         * @since 3.1.0 
     134         */ 
     135        if ( !defined('WP_ADMIN_URL') ) 
     136                define( 'WP_ADMIN_URL', 'wp-admin' ); 
    129137} 
    130138 
    131139/** 
  • wp-includes/link-template.php

     
    20542054 * @return string Admin url link with optional path appended 
    20552055*/ 
    20562056function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { 
    2057         $url = get_site_url($blog_id, 'wp-admin/', $scheme); 
     2057        $url = get_site_url($blog_id, WP_ADMIN_URL.'/', $scheme); 
    20582058 
    20592059        if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 
    20602060                $url .= ltrim($path, '/'); 
     
    22232223 * @return string Admin url link with optional path appended 
    22242224*/ 
    22252225function network_admin_url( $path = '', $scheme = 'admin' ) { 
    2226         $url = network_site_url('wp-admin/network/', $scheme); 
     2226        $url = network_site_url(WP_ADMIN_URL.'/network/', $scheme); 
    22272227 
    22282228        if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 
    22292229                $url .= ltrim($path, '/'); 
     
    22422242 * @return string Admin url link with optional path appended 
    22432243*/ 
    22442244function user_admin_url( $path = '', $scheme = 'admin' ) { 
    2245         $url = network_site_url('wp-admin/user/', $scheme); 
     2245        $url = network_site_url(WP_ADMIN_URL.'/user/', $scheme); 
    22462246 
    22472247        if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 
    22482248                $url .= ltrim($path, '/'); 
  • wp-admin/admin.php

     
    2929 
    3030require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); 
    3131 
     32$request_path = array_shift(explode('/',$_SERVER['REQUEST_URI'])); 
     33if (array_shift($request_path) != WP_ADMIN_URL) { 
     34        wp_redirect(admin_url(implode('/', $request_path))); 
     35        exit; 
     36} 
     37 
    3238if ( get_option('db_upgraded') ) { 
    3339        $wp_rewrite->flush_rules(); 
    3440        update_option( 'db_upgraded',  false );