WordPress.org

Make WordPress Core

Ticket #16238: 16238.2.diff

File 16238.2.diff, 706 bytes (added by kawauso, 7 years ago)

Respect existing dashboard suffixes

  • wp-admin/includes/template.php

     
    16611661 */
    16621662function convert_to_screen( $screen ) {
    16631663        $screen = str_replace( array('.php', '-new', '-add' ), '', $screen);
     1664
     1665        if ( substr( $screen, -8 ) != '-network' && substr( $screen, -5 ) != '-user' ) {
     1666                if ( is_network_admin() )
     1667                        $screen .= '-network';
     1668                else if ( is_user_admin() )
     1669                        $screen .= '-user';
     1670        }
     1671
    16641672        $screen = (string) apply_filters( 'screen_meta_screen', $screen );
    16651673        $screen = (object) array('id' => $screen, 'base' => $screen);
    16661674        return $screen;