Use the stylesheet rather than the template to create the network enable theme nonce. Fix network enable redirect following theme installation. Props duck_, nacin. fixes #20916
git-svn-id: https://develop.svn.wordpress.org/trunk@21062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d81496ca18
commit
d0e8e5ca35
@ -1521,7 +1521,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
|||||||
$install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>';
|
$install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate “%s”'), $name ) ) . '">' . __('Activate') . '</a>';
|
||||||
|
|
||||||
if ( is_network_admin() && current_user_can( 'manage_network_themes' ) )
|
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&theme=' . $template, 'enable-theme_' . $template ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';
|
$install_actions['network_enable'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=enable&theme=' . $stylesheet, 'enable-theme_' . $stylesheet ) ) . '" title="' . esc_attr__( 'Enable this theme for all sites in this network' ) . '" target="_parent">' . __( 'Network Enable' ) . '</a>';
|
||||||
|
|
||||||
if ( $this->type == 'web' )
|
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>';
|
$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>';
|
||||||
|
@ -40,6 +40,9 @@ if ( $action ) {
|
|||||||
check_admin_referer('enable-theme_' . $_GET['theme']);
|
check_admin_referer('enable-theme_' . $_GET['theme']);
|
||||||
$allowed_themes[ $_GET['theme'] ] = true;
|
$allowed_themes[ $_GET['theme'] ] = true;
|
||||||
update_site_option( 'allowedthemes', $allowed_themes );
|
update_site_option( 'allowedthemes', $allowed_themes );
|
||||||
|
if ( false === strpos( $referer, '/network/themes.php' ) )
|
||||||
|
wp_redirect( network_admin_url( 'themes.php?enabled=1' ) );
|
||||||
|
else
|
||||||
wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
|
wp_safe_redirect( add_query_arg( 'enabled', 1, $referer ) );
|
||||||
exit;
|
exit;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user