Filter bcn_settings_init problem
-
Hi, I found a problem with
bcn_settings_init
filter – I can’t change bcurrent_item_linked option dynamically.Use case – I have this option site-wide off / false, but one custom post type need current item linked. No problem, with
bcn_settings_init
I can change BC settings when needed. Wrong. I have this code in functions.php (without any custom post type conditions etc.):function custom_bcn_settings_init( $opt ) { $opt['bcurrent_item_linked'] = true; return $opt; } add_filter( 'bcn_settings_init', 'custom_bcn_settings_init');
Current item in breadcrumbs is not linked. There is probably something wrong with function
get_settings()
in breadcrumb-navxt.php and line:$this->breadcrumb_trail->opt = wp_parse_args(get_option('bcn_options'), $this->opt);
$this->opt are default options altered by my filter, and merged with options saved in DB.
$this->opt[‘bcurrent_item_linked’] is true, saved bcn_options’ bcurrent_item_linked is false, and $this->breadcrumb_trail->opt[‘bcurrent_item_linked’] is false, after all …
And I am lost. Does this work as intended? Or am I doing it wrong? Is it possible to overwrite admin settings with that filter?
- The topic ‘Filter bcn_settings_init problem’ is closed to new replies.