[wp-trac] [WordPress Trac] #13084: Loading Parent Theme functions BEFORE Child Theme functions
WordPress Trac
noreply at wordpress.org
Thu May 12 04:02:38 UTC 2016
#13084: Loading Parent Theme functions BEFORE Child Theme functions
--------------------------+----------------------
Reporter: oncletom | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Themes | Version: 2.9.2
Severity: normal | Resolution: wontfix
Keywords: | Focuses:
--------------------------+----------------------
Changes (by dd32):
* keywords: parent child theme =>
* status: reopened => closed
* resolution: => wontfix
Comment:
This is still a wontfix unfortunately. We just can't alter the loading
order, no matter how much you want to. Adding a constant or feature flag
isn't an option either.
If you wish to use the parent themes classes in the child theme, you
simply have to delay code execution until the `after_setup_theme` action,
for example:
{{{
add_action( 'after_setup_theme', function() {
include __DIR__ . '/class-child-theme-extends-parent-theme-class.php';
$child_theme = new Child_Theme_Class();
} );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/13084#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list