[wp-trac] [WordPress Trac] #18490: When installing a new theme, check if parent theme is required.

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 19 23:10:59 UTC 2011


#18490: When installing a new theme, check if parent theme is required.
-------------------------+-----------------------------
 Reporter:  sterlo       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:  3.2.1
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 Currently I am able to do the following:

  1. Upload a child theme.
  2. Do not have the parent theme installed (for instance, Genesis
 Framework).
  3. After the child theme is uploaded...I am presented with the option to
 activate the child theme. Even though the parent theme does not exist.

 The child theme can check this by doing something like this...
 {{{
 function genesis_failed_to_load() {
   echo '<div id="message" class="error"><p>Unable to locate the Genesis
 Framework!</p></div>';
 }

 /** Start the engine */
 if( file_exists( TEMPLATEPATH . '/lib/init.php' ) ) {
   require_once( TEMPLATEPATH . '/lib/init.php' );
 } else {
   add_action( 'admin_notices' , 'genesis_failed_to_load' );
   return false;
 }
 }}}

 But knowing most people are not using such code, allowing the activation
 of a child theme without it's parent theme can lead to site breakage.

 Fatal errors, etc.

 I propose that upon uploading, prior to providing the activation option,
 we check to see if the parent theme is installed, if it's not...then mark
 the theme as broken and don't allow them to activate.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18490>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list