WordPress OptionsTree Child Theme Function Override no longer working

I have set up a staging server under a subdomain with the same name. I cloned the site, but have upgraded the parent theme with same functionality since. The issue I am having now is that the functionality that used to override the parent theme options panel is being ignored. It is based on the OptionsTree code here https://github.com/valendesigns/option-tree . The raw code that used to load all fields to be shown front end in child theme is http://pastebin.com/DBCrfruu It is loaded from functions.php in child theme which will be included before functions.php of parent theme using this include [php]require ( get_stylesheet_directory() . ‘/theme-options.php’);[/php] Full child theme functions.php here http://pastebin.com/RPyuH47E

The OptionsTree options loaded in the parent theme (Humble Shop) is http://pastebin.com/tFVG9UZV
(adding code of both files was not allowed due to too many characters used)
The OptionsTree author suggests not to copy all code but to create a new section- https://github.com/valendesigns/option-tree/issues/402#issuecomment-62241474 .
[php]function my_ot_setting( $custom_settings ) {

// Add section
if ( isset( $custom_settings[‘sections’] ) ) {
$custom_settings[‘sections’][] = array(
‘id’ => ‘ot_dx_advertising’,
‘title’ => ‘DX Advertisement’
);
}

// Add settings
if ( isset( $custom_settings[‘settings’] ) ) {
$custom_settings[‘settings’][] = array(
‘id’ => ‘dx_banner_code’,
‘label’ => ‘Banner Code’,
‘desc’ => ‘Enter your ad code.’,
‘std’ => ‘’,
‘type’ => ‘textarea-simple’,
‘section’ => ‘ot_dx_advertising’,
‘rows’ => ‘4’,
‘post_type’ => ‘’,
‘taxonomy’ => ‘’,
‘min_max_step’ => ‘’,
‘class’ => ‘’,
‘condition’ => ‘dx_banner_selection:not(cb_banner_off)’
);
}

return $custom_settings;

}
add_filter( ‘option_tree_settings_args’, ‘my_ot_setting’ );[/php]
Only I need to add some settings to a function.

To deal with this I need to understand how this can be done. I need to state

If section is slider then add settings 1-3 and then add the filter so the theme options are updated. And due to me still being rather weak at PHP I would like to get help do do this and learn something.

Input is very much appreciated.

P.S. Yes I did open a ticket with author here https://github.com/valendesigns/option-tree/issues/537 but as he cannot do all answers quickly and extensively all the time and teach me a thing or too I opened a ticket here so I can expand my knowledge and fix this issue.

The only way i know a parent would override a child anything is if the child is not the selected theme.

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service