[wp-trac] [WordPress Trac] #13084: Loading Parent Theme functions BEFORE Child Theme functions

WordPress Trac noreply at wordpress.org
Wed May 11 10:12:18 UTC 2016


#13084: Loading Parent Theme functions BEFORE Child Theme functions
--------------------------------+-----------------------
 Reporter:  oncletom            |       Owner:
     Type:  defect (bug)        |      Status:  reopened
 Priority:  normal              |   Milestone:
Component:  Themes              |     Version:  2.9.2
 Severity:  normal              |  Resolution:
 Keywords:  parent child theme  |     Focuses:
--------------------------------+-----------------------
Changes (by sidati):

 * keywords:  parent, child, theme => parent child theme
 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 @nacin But if we want to use "heritability" like in OOP, for example this
 is not possible for the moment


 {{{#!php
 <?php

 class ParentTheme {
         function __construct(){
                 add_action('action_one', array($this, 'function_one'));
                 add_action('action_two', array($this, 'function_two'));
                 add_action('action_three', array($this,
 'function_three'));
         }

         function function_two() {
                 return 2;
         }
 }

 class ChildTheme extends ParentTheme {

         function function_two() {
                 return 9;
         }

 }
 }}}

 ----

 @greenshady Why not ? the child theme functions file is independent since
 its not related to parent function file, clearly because its called before
 it and the parent theme is developed before the child so clearly it will
 not counting on the child theme, so changing order will not make any
 difference.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/13084#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list