Make WordPress Core

Changeset 16838


Ignore:
Timestamp:
12/09/2010 04:12:04 PM (14 years ago)
Author:
nacin
Message:

Adjust branching and errors in WP_Themes_List_Table::no_items(). fixes #15751.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r16759 r16838  
    6262
    6363    function no_items() {
    64         if ( current_user_can( 'install_themes' ) ) {
    65             if ( is_multisite() )
    66                 printf( 'You only have one theme installed right now. Visit the <a href="%s">Network Admin</a> to install more themes.', network_admin_url( 'theme-install.php' ) );
    67             else
     64        if ( is_multisite() ) {
     65            if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
     66                printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ), network_admin_url( 'theme-install.php' ) );
     67
     68                return;
     69            } elseif ( current_user_can( 'manage_network_themes' ) ) {
     70                printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ) );
     71
     72                return;
     73            }
     74            // else, fallthrough. install_themes doesn't help if you can't enable it.
     75        } else {
     76            if ( current_user_can( 'install_themes' ) ) {
    6877                printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
    69         } else {
    70             printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
    71         }
     78
     79                return;
     80            }
     81        }
     82        // Fallthrough.
     83        printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
    7284    }
    7385
Note: See TracChangeset for help on using the changeset viewer.