• Resolved bill_baroud02

    (@bill_baroud02)


    Hello,

    Everything works fine except the wysiwyg fields do not save the data.

    here is my code :

    $cmb = new_cmb2_box( array(
    		'id'            => $prefix . 'public',
    		'title'         => __( 'Public', 'cmb2' ),
    		'object_types'  => array( 'evenement'), // Post type
    		'context'       => 'normal',
    		'priority'      => 'high',
    		'show_names'    => true, // Show field names on the left
    		'cmb_styles'    => true, // false to disable the CMB stylesheet
    	) );
    
    	$cmb->add_field( array(
    		'id'      => $prefix . 'content',
    		'type'    => 'wysiwyg',
    		'options' => array( 'textarea_rows' => 8, ),
    	) );

    any idea of what is wrong ?

    thanks

    https://www.ads-software.com/plugins/cmb2/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I just tried this, with the exception of the object type change, and it worked for me. Saved to post meta for the post I edited.

    <?php
    add_filter( 'cmb2_init', 'slideshow_metabox' );
    function slideshow_metabox() {
    
    	$prefix = '_slideshow_';
    	$cmb = new_cmb2_box( array(
    		'id'            => $prefix . 'public',
    		'title'         => __( 'Public', 'cmb2' ),
    		'object_types'  => array( 'post'), // Post type
    		'context'       => 'normal',
    		'priority'      => 'high',
    		'show_names'    => true, // Show field names on the left
    		'cmb_styles'    => true, // false to disable the CMB stylesheet
    	) );
    
    	$cmb->add_field( array(
    		'id'      => $prefix . 'content',
    		'type'    => 'wysiwyg',
    		'options' => array( 'textarea_rows' => 8, ),
    	) );
    }
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Did I do anything different from what you’re doing?

    Thread Starter bill_baroud02

    (@bill_baroud02)

    It’s perfectly working now, it was just because various fields had the same id… sorry.

    thank you for your answer.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome Bill.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wysiwyg fileds can't save’ is closed to new replies.