]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/themes.php
WordPress 3.5.1
[autoinstalls/wordpress.git] / wp-admin / themes.php
index cbcde87cad97217fa92f742422e85d103220db4d..7852a721364af2c6ccd91be7a942ed4e17b5df61 100644 (file)
@@ -20,7 +20,7 @@ if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
                $theme = wp_get_theme( $_GET['stylesheet'] );
                if ( ! $theme->exists() || ! $theme->is_allowed() )
                        wp_die( __( 'Cheatin’ uh?' ) );
                $theme = wp_get_theme( $_GET['stylesheet'] );
                if ( ! $theme->exists() || ! $theme->is_allowed() )
                        wp_die( __( 'Cheatin’ uh?' ) );
-               switch_theme( $theme->get_template(), $theme->get_stylesheet() );
+               switch_theme( $theme->get_stylesheet() );
                wp_redirect( admin_url('themes.php?activated=true') );
                exit;
        } elseif ( 'delete' == $_GET['action'] ) {
                wp_redirect( admin_url('themes.php?activated=true') );
                exit;
        } elseif ( 'delete' == $_GET['action'] ) {
@@ -108,10 +108,8 @@ if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?>
 <div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
 <?php elseif ( isset($_GET['activated']) ) :
                if ( isset( $_GET['previewed'] ) ) { ?>
 <div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
 <?php elseif ( isset($_GET['activated']) ) :
                if ( isset( $_GET['previewed'] ) ) { ?>
-               <div id="message2" class="updated"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>.' ), home_url( '/' ) ); ?></p></div>
-               <?php } elseif ( isset($wp_registered_sidebars) && count( (array) $wp_registered_sidebars ) && current_user_can('edit_theme_options') ) { ?>
-<div id="message2" class="updated"><p><?php printf( __('New theme activated. This theme supports widgets, please visit the <a href="%s">widgets settings</a> screen to configure them.'), admin_url( 'widgets.php' ) ); ?></p></div><?php
-               } else { ?>
+               <div id="message2" class="updated"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div>
+               <?php } else { ?>
 <div id="message2" class="updated"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php
                }
        elseif ( isset($_GET['deleted']) ) : ?>
 <div id="message2" class="updated"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php
                }
        elseif ( isset($_GET['deleted']) ) : ?>
@@ -147,6 +145,11 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
                        <li><?php printf( __('Version %s'), $ct->display('Version') ); ?></li>
                </ul>
                <p class="theme-description"><?php echo $ct->display('Description'); ?></p>
                        <li><?php printf( __('Version %s'), $ct->display('Version') ); ?></li>
                </ul>
                <p class="theme-description"><?php echo $ct->display('Description'); ?></p>
+               <?php if ( $ct->parent() ) {
+                       printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
+                               __( 'http://codex.wordpress.org/Child_Themes' ),
+                               $ct->parent()->display( 'Name' ) );
+               } ?>
                <?php theme_update_available( $ct ); ?>
        </div>
 
                <?php theme_update_available( $ct ); ?>
        </div>
 
@@ -169,7 +172,10 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
                                else
                                        $options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
                        } else if ( current_user_can($item[1]) ) {
                                else
                                        $options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
                        } else if ( current_user_can($item[1]) ) {
-                               if ( file_exists(ABSPATH . 'wp-admin/' . $item[2]) ) {
+                               $menu_file = $item[2];
+                               if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
+                                       $menu_file = substr( $menu_file, 0, $pos );
+                               if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
                                        $options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
                                } else {
                                        $options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
                                        $options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
                                } else {
                                        $options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
@@ -193,9 +199,11 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
                                <li><?php echo $option; ?></li>
                        <?php endforeach; ?>
                </ul>
                                <li><?php echo $option; ?></li>
                        <?php endforeach; ?>
                </ul>
+               <?php
+               endif; // options
+               ?>
        </div>
        <?php
        </div>
        <?php
-               endif; // options
        endif; // options || edit_theme_options
        ?>
 
        endif; // options || edit_theme_options
        ?>