Ticket #21030: 21030.diff
| File 21030.diff, 3.2 KB (added by martythornley, 11 months ago) |
|---|
-
wp-admin/themes.php
151 151 <?php 152 152 // Pretend you didn't see this. 153 153 $options = array(); 154 155 if ( current_user_can( 'edit_theme_options' ) ) 156 $options['customize'] = '<a id="customize-current-theme-link" href="' . wp_customize_url(). '" class="load-customize hide-if-no-customize" title="' . esc_attr( $customize_title ) .'">Customize</a>'; 157 154 158 if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { 155 159 foreach ( (array) $submenu['themes.php'] as $item) { 156 160 $class = ''; 161 $name = sanitize_file_name( strtolower( $item[0] ) ); 157 162 if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] ) 158 163 continue; 159 164 // 0 = name, 1 = capability, 2 = file … … 163 168 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. 164 169 $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]); 165 170 if ( file_exists(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) 166 $options[ ] = "<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";171 $options[$name] = "<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>"; 167 172 else 168 $options[ ] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";173 $options[$name] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>"; 169 174 } else if ( current_user_can($item[1]) ) { 170 175 if ( file_exists(ABSPATH . 'wp-admin/' . $item[2]) ) { 171 $options[ ] = "<a href='{$item[2]}'$class>{$item[0]}</a>";176 $options[$name] = "<a href='{$item[2]}'$class>{$item[0]}</a>"; 172 177 } else { 173 $options[ ] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";178 $options[$name] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>"; 174 179 } 175 180 } 176 181 } 177 182 } 178 179 if ( $options || current_user_can( 'edit_theme_options' ) ) : 183 $options = apply_filters( 'theme_option_links' , $options , $ct->stylesheet ); 180 184 ?> 181 <div class="theme-options">182 <?php if ( current_user_can( 'edit_theme_options' ) ) : ?>183 <a id="customize-current-theme-link" href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>"><?php _e( 'Customize' ); ?></a>184 <?php185 endif; // edit_theme_options186 if ( $options ) :187 ?>188 <span><?php _e( 'Options:' )?></span>189 <ul>190 <?php foreach ( $options as $option ) : ?>191 <li><?php echo $option; ?></li>192 <?php endforeach; ?>193 </ul>194 </div>195 <?php196 endif; // options197 endif; // options || edit_theme_options198 ?>199 185 186 <?php if ( $options || current_user_can( 'edit_theme_options' ) ) { ?> 187 <?php if ( $options ) { ?> 188 <div class="theme-options"> 189 <?php 190 if ( isset( $options['customize'] ) ) { 191 echo $options['customize']; 192 unset( $options['customize'] ); 193 } 194 ?> 195 <span><?php _e( 'Options:' )?></span> 196 <ul> 197 <?php foreach ( $options as $key => $option ) : ?> 198 <li class="<?php echo $key; ?>"><?php echo $option; ?></li> 199 <?php endforeach; ?> 200 </ul> 201 </div> 202 <?php }; ?> 203 <?php }; ?> 204 200 205 </div> 201 206 202 207 <br class="clear" />
