I need your help. I have a function in the customizer that returns a simple array of $default_options[$control] via apply_filters()
function abro_options( $control ) {
$abro_defaults = array(
'general_container_width' => 'container',
'general_menu_position' => 'left',
'sidebar_display' => true,
'sidebar_position' => 'right',
);
// Merge defaults and theme options
$abro_defaults = wp_parse_args( get_option('abro_options'), $abro_defaults );
// Return controls
return apply_filters('abro_filter_options', $abro_defaults[ $control ] );
}
How can I compare the values of child options with the default options in the child theme and change only those that match by the key?
add_filter( 'abro_filter_options','child_theme_filter_options' );
function child_theme_filter_options( $control ) {
$child_theme_defaults = array(
'general_menu_position' => 'right',
'sidebar_position' => 'left',
);
///?????
// Merge defaults and theme options
$abro_defaults = wp_parse_args( get_option('abro_options'), $abro_defaults );
return $abro_defaults[ $control ];
}