mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 18:08:09 +01:00
Only show "Add New Theme" block on Manage Themes screen if not Multisite and the user can install themes.
props markoheijnen. see #25948. Built from https://develop.svn.wordpress.org/trunk@26288 git-svn-id: http://core.svn.wordpress.org/trunk@26193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6927ba52b1
commit
b545ee773e
@ -465,7 +465,9 @@ themes.view.Themes = wp.Backbone.View.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 'Add new theme' element shown at the end of the grid
|
// 'Add new theme' element shown at the end of the grid
|
||||||
this.$el.append( '<div id="add-new" class="theme add-new"><a href="' + themes.data.settings.install_uri + '"><div class="theme-screenshot"><span></span></div><h3 class="theme-name">' + themes.data.i18n.add_new + '</h3></a></div>' );
|
if ( themes.data.settings.canInstall ) {
|
||||||
|
this.$el.append( '<div id="add-new" class="theme add-new"><a href="' + themes.data.settings.installURI + '"><div class="theme-screenshot"><span></span></div><h3 class="theme-name">' + themes.data.i18n.addNew + '</h3></a></div>' );
|
||||||
|
}
|
||||||
|
|
||||||
this.parent.page++;
|
this.parent.page++;
|
||||||
},
|
},
|
||||||
|
2
wp-admin/js/theme.min.js
vendored
2
wp-admin/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
@ -91,7 +91,8 @@ if ( current_user_can( 'switch_themes' ) ) {
|
|||||||
wp_localize_script( 'theme', '_wpThemeSettings', array(
|
wp_localize_script( 'theme', '_wpThemeSettings', array(
|
||||||
'themes' => $themes,
|
'themes' => $themes,
|
||||||
'settings' => array(
|
'settings' => array(
|
||||||
'install_uri' => admin_url( 'theme-install.php' ),
|
'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ),
|
||||||
|
'installURI' => admin_url( 'theme-install.php' ),
|
||||||
'customizeURI' => ( current_user_can( 'edit_theme_options' ) ) ? wp_customize_url() : null,
|
'customizeURI' => ( current_user_can( 'edit_theme_options' ) ) ? wp_customize_url() : null,
|
||||||
'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
|
'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ),
|
||||||
'root' => '/wp-admin/themes.php',
|
'root' => '/wp-admin/themes.php',
|
||||||
@ -99,7 +100,7 @@ wp_localize_script( 'theme', '_wpThemeSettings', array(
|
|||||||
'extraRoutes' => '',
|
'extraRoutes' => '',
|
||||||
),
|
),
|
||||||
'i18n' => array(
|
'i18n' => array(
|
||||||
'add_new' => __( 'Add New Theme' ),
|
'addNew' => __( 'Add New Theme' ),
|
||||||
),
|
),
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user