Changeset 30793 for trunk/src/wp-admin/themes.php
- Timestamp:
- 12/08/2014 10:22:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/themes.php
r30697 r30793 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 }
Note: See TracChangeset
for help on using the changeset viewer.