Themes: Use Customizer deep-links inside the theme modal.

props DrewAPicture, ocean90.
see #25569, #25571.
fixes #30553.
Built from https://develop.svn.wordpress.org/trunk@30793


git-svn-id: http://core.svn.wordpress.org/trunk@30783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-12-08 22:23:23 +00:00
parent 93078d7d9f
commit 332e0a7f82
6 changed files with 33 additions and 10 deletions

View File

@ -580,6 +580,12 @@ body.folded .theme-overlay .theme-wrap {
margin-bottom: 5px;
}
/* Hide-if-customize for items we can't add classes to */
.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"],
.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"] {
display: none;
}
.broken-themes a.delete-theme,
.theme-overlay .theme-actions .delete-theme {
color: #a00;

View File

@ -580,6 +580,12 @@ body.folded .theme-overlay .theme-wrap {
margin-bottom: 5px;
}
/* Hide-if-customize for items we can't add classes to */
.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"],
.customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"] {
display: none;
}
.broken-themes a.delete-theme,
.theme-overlay .theme-actions .delete-theme {
color: #a00;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -164,22 +164,33 @@ if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() )
continue;
// 0 = name, 1 = capability, 2 = file
if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
$class = ' class="current"';
$class = ' current';
if ( !empty($submenu[$item[2]]) ) {
$submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
$menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
$current_theme_actions[] = "<a class='button button-secondary' href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
$current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
else
$current_theme_actions[] = "<a class='button button-secondary' href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
} else if ( current_user_can($item[1]) ) {
$current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
$menu_file = $item[2];
if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
if ( current_user_can( 'customize' ) ) {
if ( 'custom-header' === $menu_file ) {
$current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
} elseif ( 'custom-background' === $menu_file ) {
$current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
}
}
if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) {
$menu_file = substr( $menu_file, 0, $pos );
}
if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
$current_theme_actions[] = "<a class='button button-secondary' href='{$item[2]}'$class>{$item[0]}</a>";
$current_theme_actions[] = "<a class='button button-secondary$class' href='{$item[2]}'>{$item[0]}</a>";
} else {
$current_theme_actions[] = "<a class='button button-secondary' href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
$current_theme_actions[] = "<a class='button button-secondary$class' href='themes.php?page={$item[2]}'$>{$item[0]}</a>";
}
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.1-beta2-30792';
$wp_version = '4.1-beta2-30793';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.