WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 months ago

Last modified 3 months ago

#37619 closed feature request (invalid)

Feature to Insert Child Property In Parent Theme Customizer

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

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
3 years ago

  • Severity changed from normal to major

#2 @swissspidy
3 years ago

  • Focuses ui accessibility administration template removed
  • Severity changed from major to normal

#3 @westonruter
3 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
3 years ago

  • Keywords close added

#5 @desrosj
3 months ago

  • Keywords close removed
  • Resolution set to invalid
  • Status changed from new to closed

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

#6 @desrosj
3 months ago

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