Adjust branching and errors in WP_Themes_List_Table::no_items(). fixes #15751.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5aafa64e34
commit
42407cf411
|
@ -61,14 +61,26 @@ class WP_Themes_List_Table extends WP_List_Table {
|
||||||
}
|
}
|
||||||
|
|
||||||
function no_items() {
|
function no_items() {
|
||||||
if ( current_user_can( 'install_themes' ) ) {
|
if ( is_multisite() ) {
|
||||||
if ( is_multisite() )
|
if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
|
||||||
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' ) );
|
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' ) );
|
||||||
else
|
|
||||||
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' ) );
|
return;
|
||||||
} else {
|
} elseif ( current_user_can( 'manage_network_themes' ) ) {
|
||||||
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
|
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'] ) );
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
// else, fallthrough. install_themes doesn't help if you can't enable it.
|
||||||
|
} else {
|
||||||
|
if ( current_user_can( 'install_themes' ) ) {
|
||||||
|
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' ) );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Fallthrough.
|
||||||
|
printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_table() {
|
function display_table() {
|
||||||
|
|
Loading…
Reference in New Issue