Wysiwyg id in group

Support MB Group Wysiwyg id in group

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4626
    olivier.dupuisolivier.dupuis
    Participant

    Hello,

    I have 2 groups, and in each group a wysiwyg Field. Like so :

    add_filter( 'rwmb_meta_boxes', 'my_meta_boxes' );
    
    function my_meta_boxes( $meta_boxes ) {
    
    	$prefix = 'custom_';
    	
    	$meta_boxes[] = array(
    	
    		'id'		=>	$prefix . 'box',
    	    'title'		=>	'My metabox',
    		'pages' 	=>	array( 'page' ),
    		'context' 	=>	'normal',
    		'priority' 	=>	'low',
    		
    		'fields'	=> array(
    	    
    	    	array(
    		
    	            'name'	=>	'My first group',
    	            'id'	=>	$prefix . 'group_1',
    	            'type'	=>	'group',
    	            
    	            'fields'		=>	array(
    	            
    	                array(
    	                
    	                    'name'	=>	'Text',
    	                    'id'	=>	'text',
    	                    'type'	=>	'wysiwyg',
    	                ),
    	                
    	            ),
    			),
    	    
    	    	array(
    		
    	            'name'	=>	'My Second group',
    	            'id'	=>	$prefix . 'group_2',
    	            'type'	=>	'group',
    	            
    	            'fields'		=>	array(
    	            
    	                array(
    	                
    	                    'name'	=>	'Text',
    	                    'id'	=>	'text',
    	                    'type'	=>	'wysiwyg',
    	                ),
    	                
    	            ),
    			),
            ),
    	);
    	
    	return $meta_boxes;
    }

    The wysiwyg of the second group is broken and doesn't display properly :

    Screenshot

    Any idea ? Thanks

    #4635
    Anh TranAnh Tran
    Keymaster

    I see you’re using Advanced TinyMCE plugin. Can you try deactivating it and checking again?

    #4639
    olivier.dupuisolivier.dupuis
    Participant

    Dear Anh. Thank you for your reply.

    I tried deactivating Advanced TinyMCE plugin. The wysiwyg of the second group is still broken.

    I noticed that it works if I set different id to the wysiwyg fields but I don't understand why I have to do that. Setting different id for groups ins't sufficent ?

    #4645
    Anh TranAnh Tran
    Keymaster

    I think the problem is 2 wysiwyg fields have the same ID. You need to change them to have different IDs.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Wysiwyg id in group’ is closed to new replies.