Add 'Network Enable' link after installing a theme in the network admin. props PeteMall, fixes #18468.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-08-18 22:40:37 +00:00
parent e3117daaa8
commit 0fe8ea2f72
2 changed files with 4 additions and 1 deletions

View File

@ -1354,6 +1354,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>'
);
if ( is_network_admin() && current_user_can( 'manage_network_themes' ) )
$install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';
if ( $this->type == 'web' )
$install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
else

View File

@ -40,7 +40,7 @@ if ( $action ) {
check_admin_referer('enable-theme_' . $_GET['theme']);
$allowed_themes[ $_GET['theme'] ] = true;
update_site_option( 'allowedthemes', $allowed_themes );
wp_redirect( add_query_arg( 'enabled', '1', $referer ) );
wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
exit;
break;
case 'disable':