Problems with the latest version of metabox vs mmb-settings-page

Support MB Settings Page Problems with the latest version of metabox vs mmb-settings-page

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #3850
    Infolu OfficialInfolu Official
    Participant

    After solving the problem of maps, the update came into conflict with the mb-settings-page where the tabs are not loaded

    https://github.com/rilwis/meta-box/issues/943

    #3855
    Anh TranAnh Tran
    Keymaster

    Thanks for reporting. Let me check with @funkedgeek on Github.

    #3868
    Infolu OfficialInfolu Official
    Participant

    hello any news on this? to not run out settings pages'm using the old version which had problems with maps.

    #3878
    Anh TranAnh Tran
    Keymaster

    I'm still checking :(. I will try to fix it asap.

    #3879
    Anh TranAnh Tran
    Keymaster

    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).

    #3887
    Infolu OfficialInfolu Official
    Participant

    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;
    }
    #3905
    Infolu OfficialInfolu Official
    Participant

    Staff without news? I'm still or use but or use the page settings, I can not use both 🙁

    #3910
    Anh TranAnh Tran
    Keymaster

    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?

    #3911
    Infolu OfficialInfolu Official
    Participant

    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.

    #3912
    Anh TranAnh Tran
    Keymaster

    Yes, the latest version on Github has the fix for map and that's the version I'm using. Or am I misunderstanding something?

    #3914
    Infolu OfficialInfolu Official
    Participant

    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

    #3916
    Infolu OfficialInfolu Official
    Participant

    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

    #3931
    Anh TranAnh Tran
    Keymaster

    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?

    #3937
    Infolu OfficialInfolu Official
    Participant

    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

    #3940
    Anh TranAnh Tran
    Keymaster

    I've recorded a video. It works on my case :(. Please take a look:

    http://take.ms/tuZCc

    PS: To download the latest version on Github, please use this link:

    https://github.com/rilwis/meta-box/archive/master.zip

Viewing 15 posts - 1 through 15 (of 19 total)
  • The topic ‘Problems with the latest version of metabox vs mmb-settings-page’ is closed to new replies.