I did a settings page called "theme" and assigned some custom fields to it.
My goal is to access a settings page value in JS.
I noticed that I can't get values inside wp_add_inline_script()
or wp_localize_script()
since rwmb_get_value('social', ['object_type' => 'setting'], 'theme')
will return null
values.
However, I was able to access the settings values with get_option('theme')
, but noticed that this is still true if I deactivate the meta box plugin.
Once I declared a settings page custom field, it won't get removed from the theme options if I remove the custom field in MB AiO.
How can I get rid of old settings page fields, so they don't get returned in get_option()
?