Title: Filter bcn_settings_init problem
Last modified: June 19, 2019

---

# Filter bcn_settings_init problem

 *  Resolved [mklusak](https://wordpress.org/support/users/mklusak/)
 * (@mklusak)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/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?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [John Havlik](https://wordpress.org/support/users/mtekk/)
 * (@mtekk)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/filter-bcn_settings_init-problem/#post-11663705)
 * The `bcn_settings_init` filter is intended for providing good/safe default values
   for settings in the plugin. This can be for existing settings, or for extension
   plugins to Breadcrumb NavXT that have options (the primary user of this filter).
   If you want to dynamically change a setting, you’re better off using the `bcn_before_fill`
   action and modifying the specific option when appropriate (e.g. when on a page
   for that CPT).
 *  Thread Starter [mklusak](https://wordpress.org/support/users/mklusak/)
 * (@mklusak)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/filter-bcn_settings_init-problem/#post-11665463)
 * Hm, I see. Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter bcn_settings_init problem’ is closed to new replies.

 * ![](https://ps.w.org/breadcrumb-navxt/assets/icon.svg?rev=1927103)
 * [Breadcrumb NavXT](https://wordpress.org/plugins/breadcrumb-navxt/)
 * [Support Threads](https://wordpress.org/support/plugin/breadcrumb-navxt/)
 * [Active Topics](https://wordpress.org/support/plugin/breadcrumb-navxt/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/breadcrumb-navxt/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/breadcrumb-navxt/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mklusak](https://wordpress.org/support/users/mklusak/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/filter-bcn_settings_init-problem/#post-11665463)
 * Status: resolved