I'm using a commercial theme that has it's theme settings in WordPress's appearance/customizer. They call their settings through a function like this: (this is only part of the function which is about 400 lines long)
function customizer_library_gateway_options() {
// Home
$section = 'home';
$sections[] = array(
'id' => $section,
'title' => __( 'Home', 'gateway' ),
'priority' => '20',
'description' => __( 'Home Page Options.', 'gateway' ),
'panel' => $panel
);
$options['home_hero_bg'] = array(
'id' => 'home_hero_bg',
'label' => __( 'Home Background Image', 'gateway' ),
'section' => $section,
'type' => 'image',
'default' => $imagepath . 'hero-bg.jpg',
'active_callback' => 'is_front_page'
);
$options['bg_attachement'] = array(
'id' => 'bg_attachement',
'label' => __( 'Select the behavior of the background image.', 'gateway' ),
'section' => $section,
'type' => 'select',
'choices' => $bg_attachment,
'default' => 'fixed',
'active_callback' => 'is_front_page'
);
$options['home_hero_bg_color'] = array(
'id' => 'home_hero_bg_color',
'label' => __( 'Home Hero background color if no image is being used.', 'gateway' ),
'section' => $section,
'type' => 'color',
'default' => $primary_color,
'active_callback' => 'is_front_page',
'transport' => 'postMessage'
);
$options['home_posts_title'] = array(
'id' => 'home_posts_title',
'label' => __( 'Enter the home featured posts section title', 'gateway' ),
'section' => $section,
'type' => 'text',
'default' => 'Featured Posts',
'active_callback' => 'is_front_page',
'transport' => 'postMessage'
);
$options['home_posts_cat'] = array(
'id' => 'home_posts_cat',
'label' => __( 'Home Posts Category', 'gateway' ),
'section' => $section,
'type' => 'select',
'choices' => $options_cats,
'default' => '',
'active_callback' => 'is_front_page'
);
}
add_action( 'init', 'customizer_library_gateway_options' );
My question is: How can I add to this array through my child theme so I can add a logo option? I don't necessarily want to re-declare the whole function if I can just add my array insertion:
I was thinking add_filter but I'm not sure. This is what I tried in my child theme functions.php:
function customizer_library_gateway_home_logo() {
$options['home_logo'] = array(
'id' => 'home_logo',
'label' => __( 'Logo', 'gateway' ),
'section' => 'home',
'type' => 'image',
'default' => $imagepath . 'logo.png'
);
}
add_filter( 'customizer_library_gateway_options', 'customizer_library_gateway_home_logo' );
However, no change is made to the theme customizer. If I add the home_logo entry directly in the theme's original file it does work. Maybe there is a different action I should be using?