First WYSIWYG in group not switching between Visual and Text tabs.

Support MB Group First WYSIWYG in group not switching between Visual and Text tabs.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4679
    NamennajNamennaj
    Participant

    I am using a wysiwyg in a group. However, for the first wysiwyg I am not able to switch between the Visual and Text tabs. The rest works as expected.

    $meta_boxes[] = array(
            'title'      => __( 'Legal Area Sections', 'textdomain' ),
            'post_types' => 'page',
            'include'   => array(
                'relation'    => 'OR',
                'template' => array( 'page-legal.php' ),
            ),
    		'fields'     => array(
    			array(
    				'name' => 'Section', // Optional
    				'id' => 'legal_section',
    				'type' => 'group',
    				'clone' => true,
    				// List of sub-fields
    				'fields' => array(
    					array(
    						'id'   => 'title',
    						'name' => __( 'Section Title', 'textdomain' ),
    						'type' => 'text',
    					),
                        array(
                            'id'   => 'content',
                            'name' => __( 'Section Content', 'textdomain' ),
                            'type' => 'wysiwyg',
                        ),
    					// Other sub-fields here
    				),
    			),
    		),
    	);
    #4680
    Anh TranAnh Tran
    Keymaster

    Don’t use "content" as the wysiwyg field ID as it’s used for the main post content. That breaks the JS code for the field. Please try changing it to something else.

    #4710
    NamennajNamennaj
    Participant

    @rilwis That fixed it thx!! Do you have a guide on naming conventions?

    #4711
    Anh TranAnh Tran
    Keymaster

    Currently not, but I think and "id" should be:

    - unique per fields
    - use only lower characters with dash or underscores to separate words (think it like slugs or keys of an array)

    That's all. Very simple 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘First WYSIWYG in group not switching between Visual and Text tabs.’ is closed to new replies.