Support Forum
Support › MB Settings Page › Problems with the latest version of metabox vs mmb-settings-page
After solving the problem of maps, the update came into conflict with the mb-settings-page where the tabs are not loaded
Thanks for reporting. Let me check with @funkedgeek on Github.
hello any news on this? to not run out settings pages'm using the old version which had problems with maps.
I'm still checking :(. I will try to fix it asap.
Ah, I've just found the bug.
Please set the tab
attribute for meta box, not for fields. So:
- Settings page define tabs
- Meta box define tab (where it belongs to)
Please check out the documentation for the correct code.
Note: this is different from the Meta Box tabs extension, where:
- Meta Box defines tabs
- Fields define tab (where it belongs to)
In combination of both Settings Page & Meta Box tabs, ideally you can create tabs for page and sub-tabs for fields 😉 (Just the idea, I haven't tested it yet).
Hello Anh Tran, I'm using the example where the tab is defined in metabox but it does not work.
/ Register settings page. In this case, it's a theme options page
add_filter( 'mb_settings_pages', 'prefix_options_page' );
function prefix_options_page( $settings_pages )
{
$settings_pages[] = array(
'id' => 'pencil',
'option_name' => 'pencil',
'menu_title' => __( 'Pencil', 'textdomain' ),
'icon_url' => 'dashicons-edit',
'style' => 'no-boxes',
'columns' => 1,
'tabs' => array(
'general' => __( 'General Settings', 'textdomain' ),
'design' => __( 'Design Customization', 'textdomain' ),
'faq' => __( 'FAQ & Help', 'textdomain' ),
),
'position' => 68,
);
return $settings_pages;
}
// Register meta boxes and fields for settings page
add_filter( 'rwmb_meta_boxes', 'prefix_options_meta_boxes' );
function prefix_options_meta_boxes( $meta_boxes )
{
$meta_boxes[] = array(
'id' => 'general',
'title' => __( 'General', 'textdomain' ),
'settings_pages' => 'pencil',
'tab' => 'general',
'fields' => array(
array(
'name' => __( 'Logo', 'textdomain' ),
'id' => 'logo',
'type' => 'file_input',
),
array(
'name' => __( 'Layout', 'textdomain' ),
'id' => 'layout',
'type' => 'image_select',
'options' => array(
'sidebar-left' => 'http://i.imgur.com/Y2sxQ2R.png',
'sidebar-right' => 'http://i.imgur.com/h7ONxhz.png',
'no-sidebar' => 'http://i.imgur.com/m7oQKvk.png',
),
),
),
);
$meta_boxes[] = array(
'id' => 'colors',
'title' => __( 'Colors', 'textdomain' ),
'settings_pages' => 'pencil',
'tab' => 'design',
'fields' => array(
array(
'name' => __( 'Heading Color', 'textdomain' ),
'id' => 'heading-color',
'type' => 'color',
),
array(
'name' => __( 'Text Color', 'textdomain' ),
'id' => 'text-color',
'type' => 'color',
),
),
);
$meta_boxes[] = array(
'id' => 'info',
'title' => __( 'Theme Info', 'textdomain' ),
'settings_pages' => 'pencil',
'tab' => 'faq',
'fields' => array(
array(
'type' => 'custom_html',
'std' => __( '<strong>Having questions?</strong><br><br><a href="https://metabox.io/docs/" target="_blank" class="button-primary">Go to our documentation</a>', 'textdomain' ),
),
),
);
return $meta_boxes;
}
Staff without news? I'm still or use but or use the page settings, I can not use both 🙁
That's quite strange to me. I'm using the latest version on Github and tested with the code above. Everything seems to be fine :(.
Can you try the latest version of both plugins?
Hello
when I say that I am using the latest version is that the Fix bug funkedgeek with rwmb_meta function ... with a fix for the problem https://github.com/rilwis/meta-box/issues/943 ie the latest version
https://github.com/rilwis/meta-box/archive/master.zip
https://github.com/rilwis/meta-box/releases the release version has the fix for map.
Yes, the latest version on Github has the fix for map and that's the version I'm using. Or am I misunderstanding something?
Not the release version does not have the latest updates
Version Release maps does not work for me, however works settings pages
Version master works maps but it does not work settings pages.
A note is the problem of maps for online and not on localhost
See Moment funkedgeek resolvel the problem of maps and acrecentou the Wierd correction || check Caused 'rwmb_meta' to default to backup function
instead of built into fields functions (which solved many other problems)
https://github.com/rilwis/meta-box/issues/943
If you look the release inc / inc / functions.php
You will notice that neither was the bustituido | | per &&
ie the release version is not the version with online maps to fix the funkedgeek resolvel.
the master version on the other hand is the version with the latest fixes more than this unfortunately with problems with the pages configuration addon.
My addon configuration pages is the Version: 1.1.2
In my tests I edited the inc/core.php file
/**
* Register hooks.
*/
public function __construct()
{
$plugin = 'meta-box/meta-box.php';
add_filter( "plugin_action_links_$plugin", array( $this, 'plugin_links' ) );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
//EDIT init per admin_init
add_action( 'init', array( $this, 'register_meta_boxes' ) );
add_action( 'init', array( $this, 'register_wpml_hooks' ) );
add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
}
PER
/**
* Register hooks.
*/
public function __construct()
{
$plugin = 'meta-box/meta-box.php';
add_filter( "plugin_action_links_$plugin", array( $this, 'plugin_links' ) );
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
//EDIT init per admin_init
add_action( 'admin_init', array( $this, 'register_meta_boxes' ) );
add_action( 'admin_init', array( $this, 'register_wpml_hooks' ) );
add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
}
and edited the file inc / metabox.php
In the master version file has been removed to the lower part
/**
* Get field class name. Only for backward compatibility.
* @param array $field Field array
* @return string Field class name
*/
public static function get_class_name( $field )
{
return RWMB_Field::get_class_name( $field );
}
For me it worked the above modifications
I was making the changes on the extension locally and forgot to update it. That's why it was working for me :(. I've just released a new version of the extension. Can you try it again?
Hi Anh Tran,unfortunately for me not work, I'm Environment
Below
metabox-master (Release does not have the correction of maps)
metabox 1.1.3 pages settings
wordpress 4.6
It only works with the changes I mentioned above in core.php files and meta-box.php
I've recorded a video. It works on my case :(. Please take a look:
PS: To download the latest version on Github, please use this link: