Support Forum
Support › MB Settings Page › Problem with default value of field typesResolved
Hi,
i'm using latest plugin version. Today i noticed, that my custom fields of types (text, datetime, .. and maybe other) have a default value of empty brackets "[]" - if i setup "std" to another default value, nothing is happen - still the brackets. If i change value to something and make save, the value is correctly saving..
Next, i have noticed, that developer console only on settings page has "Uncaught ReferenceError: QTags is not defined".
add_filter( 'mb_settings_pages', 'mb_v2018' );
function mb_v2018( $settings_pages ) {
$settings_pages[] = array(
'id' => 'v2018',
'menu_title' => __('Settings',TEXTDOMAIN),
'parent' => 'edit.php?post_type=vol2018'
);
return $settings_pages;
}
...
$meta_boxes[] = array(
'id' => 'vol_options',
'title' => __('Options',TEXTDOMAIN),
'settings_pages' => 'v2018',
'fields' => array(
array(
'name' => __('Something', TEXTDOMAIN ),
'id' => "{$prefix}something",
'type' => 'text',
'std' => 'test'
)
)
)
Hi Hazmi,
Regarding the 1st problem, can you please describe steps to replicate it? I couldn't replicate on my side. But my guess is the saved value in the DB. If you already saved values of your fields into an option, then when you add a new field which has name already registered before, then the value might be taken from the previous one. Not sure if that's the case, but you can try remove the option in the DB and try again.
Regarding the problem with QTag, do you have any wysiwyg field in your settings page? QTags is available only for the editor. With the code above, I can't see anything in the console:
Hi,
1/ i have a setting page from the code i have posted, every custom field for user input (text, datetime, ..) i create has an "[]" as default value :/ and param "std" with my value doesn't work
A new problem for me here - custom field "taxonomy" on setting page doesn't save my data ("taxonomy_advanced" is ok) :/
2/ no, i haven't any wysiwyg
Hi there,
Taxonomy field doesn't save data to post meta or options, it is used for assigning a taxonomy to a post. You should use taxonomy_advanced instead. Read more here: https://docs.metabox.io/fields/taxonomy/#data
For other problems, please wait for us to check it.
Thanks.
Hi,
any progress with this (2 months)?
Hi there,
Sorry for late reply. I checked many times but can't get your problem. Did you try with 2017 theme and all plugins are deactivated?