Make WordPress Core

Changeset 16994


Ignore:
Timestamp:
12/16/2010 09:31:42 AM (12 years ago)
Author:
nacin
Message:

Make network_admin_url() return admin_url() when not multisite like its home and site counterparts. Kill the now redundant maybe_network_admin_url() function. fixes #15840.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import.php

    r16980 r16994  
    109109            }
    110110            if ( empty($action) )
    111                 $action = '<a href="' . esc_url( maybe_network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
     111                $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
    112112                                        '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
    113113                                        esc_attr__('Install importer') . '">' . $data[0] . '</a>';
     
    131131
    132132if ( current_user_can('install_plugins') )
    133     echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( maybe_network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
     133    echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
    134134?>
    135135
  • trunk/wp-admin/includes/update.php

    r16978 r16994  
    101101    switch ( $cur->response ) {
    102102    case 'development' :
    103         return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], maybe_network_admin_url( 'update-core.php' ) );
     103        return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], network_admin_url( 'update-core.php' ) );
    104104    break;
    105105
    106106    case 'upgrade' :
    107         return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', maybe_network_admin_url( 'update-core.php' ), $cur->current);
     107        return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', network_admin_url( 'update-core.php' ), $cur->current);
    108108    break;
    109109
     
    131131
    132132    if ( current_user_can('update_core') ) {
    133         $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, maybe_network_admin_url( 'update-core.php' ) );
     133        $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
    134134    } else {
    135135        $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
     
    149149
    150150    if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) {
    151         $msg .= " <a href='" . maybe_network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
     151        $msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
    152152    }
    153153
  • trunk/wp-includes/admin-bar.php

    r16978 r16994  
    275275    $update_title .= '</span>';
    276276
    277     $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => maybe_network_admin_url( 'update-core.php' ) ) );
     277    $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
    278278}
    279279
  • trunk/wp-includes/link-template.php

    r16977 r16994  
    22242224*/
    22252225function network_admin_url( $path = '', $scheme = 'admin' ) {
     2226    if ( ! is_multisite() )
     2227        return admin_url( $path, $scheme );
     2228
    22262229    $url = network_site_url('wp-admin/network/', $scheme);
    22272230
     
    22682271    else
    22692272        return admin_url($path, $scheme);
    2270 }
    2271 
    2272 /**
    2273  * Retrieve the url to the admin area for either the current blog or the network
    2274  * depending on whether multisite is enabled.
    2275  *
    2276  * @since 3.1.0
    2277  *
    2278  * @param string $path Optional path relative to the admin url
    2279  * @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.
    2280  * @return string Admin url link with optional path appended
    2281 */
    2282 function maybe_network_admin_url( $path = '', $scheme = 'admin' ) {
    2283     if ( is_multisite() )
    2284         return network_admin_url( $path, $scheme );
    2285     else
    2286         return admin_url( $path, $scheme );
    22872273}
    22882274
Note: See TracChangeset for help on using the changeset viewer.