Make WordPress Core

Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#37619 closed feature request (invalid)

Feature to Insert Child Property In Parent Theme Customizer

Reported by: footballnasha Owned by:
Priority: normal Milestone:
Component: Customize Version:
Severity: normal Keywords: reporter-feedback
Cc: Focuses:

Description

Please Allow possiblity to insert extra properties from child theme to parent theme existing customizer options.
For Ex:

Suppose there is Color Section Created in parent theme
If I want to add extra color options from child theme to same Existing Color section Of parent theme its Not possible at the moment.

Change History (6)

#1 @footballnasha
10 years ago

  • Severity normalmajor

#2 @swissspidy
10 years ago

  • Focuses ui accessibility administration template removed
  • Severity majornormal

#3 @westonruter
10 years ago

  • Keywords reporter-feedback added

@footballnasha How is this not possible? In your child theme you'd just add new controls for the desired settings and add it to the same Customizer section that the parent them creates/uses. The issue you may be encountering is that the child theme's customize_register handler is firing before the parent theme's, since the child theme's functions.php is loaded before the parent theme's functions.php. So what you need to do is use the action priority to ensure that the child theme's code runs after. So for example:

<?php
# parent-theme/functions.php
// ...
add_action( 'customize_register', 'parent_theme_customize_register', 10 );
<?php
# child-theme/functions.php
// ...
add_action( 'customize_register', 'child_theme_customize_register', 11 );

Note how the parent theme's customize_register hook has a priority lower than the child theme's hook, so this ensures the parent theme's hook will run first, and any section created in it will be ensured to exist when the child theme's hook runs.

#4 @celloexpressions
10 years ago

  • Keywords close added

#5 @desrosj
7 years ago

  • Keywords close removed
  • Resolutioninvalid
  • Status newclosed

Closing this out as it appears the request is possible, and there has been a lack of reporter feedback.

#6 @desrosj
7 years ago

  • Version 4.5.3
Note: See TracTickets for help on using tickets.