[custom metafields] TinyMCE support

WordPress Event Management, Calendars & Registration Forums General Question [custom metafields] TinyMCE support

This topic contains 4 replies, has 2 voices, and was last updated by  Iurii Smuglov 10 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7634

    Hi, Stephen.
    I have tried to add TinyMCE support for custom metafields, but there is one problem. TinyMCE now dont adds p and br tags automatically in custom metafields. Could you please tell me, Is it my mistake?
    Code:

    function metabox_callback_norsk( $venue ){
    
    $norsk = eo_get_venue_meta($venue->term_id, '_norsk',true);
        wp_nonce_field('metabox_callback_norsk', 'nonce_field_norsk' ); ?>
        

    <? $initial_data_norsk = $norsk ; $settings_norsk = array( 'textarea_name'=> 'norsk-venue',//name you want for the textarea 'textarea_value'=> esc_attr($norsk), ); $editor_id_norsk = 'editor_id_norsk'; wp_editor($initial_data_norsk,$editor_id_norsk,$settings_norsk); ?>

    <?php }

    Iurii Smuglov
    #7644

    Try passing it through wpautop():

    $value = wpautop( $value );

    before eo_update_venue_meta(),

    Stephen Harris
    #7658

    What $value should i use? 🙂

    eo_update_venue_meta($venue_id,  '_norsk', $_POST['norsk-venue']);
    Iurii Smuglov
    #7663

    Sorry,

    $value = wpautop( $_POST['norsk-venue'] );
    eo_update_venue_meta($venue_id,  '_norsk', $value);
    Stephen Harris
    #7673

    Thanks a lot, Stepheh.
    It adds those tags only after saving Venue, but it works anyway.

    Iurii Smuglov
Viewing 5 posts - 1 through 5 (of 5 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.