Ticket #30553: 30553.2.diff
File 30553.2.diff, 3.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/themes.css
580 580 margin-bottom: 5px; 581 581 } 582 582 583 /* Hide-if-customize for items we can't add classes to */ 584 .customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-header"], 585 .customize-support .theme-overlay .theme-actions a[href="themes.php?page=custom-background"] { 586 display: none; 587 } 588 583 589 .broken-themes a.delete-theme, 584 590 .theme-overlay .theme-actions .delete-theme { 585 591 color: #a00; -
src/wp-admin/themes.php
164 164 continue; 165 165 // 0 = name, 1 = capability, 2 = file 166 166 if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) 167 $class = ' c lass="current"';167 $class = ' current'; 168 168 if ( !empty($submenu[$item[2]]) ) { 169 169 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 170 170 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 171 171 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 172 $current_theme_actions[] = "<a class='button button-secondary ' href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";172 $current_theme_actions[] = "<a class='button button-secondary$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; 173 173 else 174 $current_theme_actions[] = "<a class='button button-secondary ' href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";175 } else if ( current_user_can($item[1]) ) {174 $current_theme_actions[] = "<a class='button button-secondary$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; 175 } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { 176 176 $menu_file = $item[2]; 177 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) 177 178 if ( current_user_can( 'customize' ) ) { 179 if ( 'custom-header' === $menu_file ) { 180 $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>"; 181 } elseif ( 'custom-background' === $menu_file ) { 182 $current_theme_actions[] = "<a class='button button-secondary hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>"; 183 } 184 } 185 186 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) { 178 187 $menu_file = substr( $menu_file, 0, $pos ); 188 } 189 179 190 if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { 180 $current_theme_actions[] = "<a class='button button-secondary ' href='{$item[2]}'$class>{$item[0]}</a>";191 $current_theme_actions[] = "<a class='button button-secondary$class' href='{$item[2]}'>{$item[0]}</a>"; 181 192 } else { 182 $current_theme_actions[] = "<a class='button button-secondary ' href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";193 $current_theme_actions[] = "<a class='button button-secondary$class' href='themes.php?page={$item[2]}'$>{$item[0]}</a>"; 183 194 } 184 195 } 185 196 }