/** * Enable multiple themes on a network. * * @ticket 30594 */ function test_wp_theme_network_enable_multiple_themes() { if (!is_multisite()) { $this->markTestSkipped('This test requires multisite'); } $themes = array('testtheme-2', 'testtheme-3'); $current_allowed_themes = get_site_option('allowedthemes'); WP_Theme::network_enable_theme($themes); $new_allowed_themes = get_site_option('allowedthemes'); update_site_option('allowedthemes', $current_allowed_themes); // reset previous value. $current_allowed_themes = array_merge($current_allowed_themes, array('testtheme-2' => true, 'testtheme-3' => true)); $this->assertEqualSetsWithIndex($current_allowed_themes, $new_allowed_themes); }
wp_safe_redirect(add_query_arg('enabled', 1, $referer)); } exit; case 'disable': check_admin_referer('disable-theme_' . $_GET['theme']); WP_Theme::network_disable_theme($_GET['theme']); wp_safe_redirect(add_query_arg('disabled', '1', $referer)); exit; case 'enable-selected': check_admin_referer('bulk-themes'); $themes = isset($_POST['checked']) ? (array) $_POST['checked'] : array(); if (empty($themes)) { wp_safe_redirect(add_query_arg('error', 'none', $referer)); exit; } WP_Theme::network_enable_theme((array) $themes); wp_safe_redirect(add_query_arg('enabled', count($themes), $referer)); exit; case 'disable-selected': check_admin_referer('bulk-themes'); $themes = isset($_POST['checked']) ? (array) $_POST['checked'] : array(); if (empty($themes)) { wp_safe_redirect(add_query_arg('error', 'none', $referer)); exit; } WP_Theme::network_disable_theme((array) $themes); wp_safe_redirect(add_query_arg('disabled', count($themes), $referer)); exit; case 'update-selected': check_admin_referer('bulk-themes'); if (isset($_GET['themes'])) {