wp_editor content doesn’t show in theme option

I try to insert wp_editor. Everything is fine but the content doesn’t show up after save content.

function display_slogan_element() {
    $editor_id = "home_slogan";
    $editor_class = "slogan";
    $textarea_name = "slogan";
    $content = get_post_meta( $post->ID, 'slogan', true);
    $settings = array('teeny'=> TRUE);

    wp_editor( $content, $editor_id, $settings = array() );

}

I’m not sure what is the problem. Anyone can help me ?

Related posts

1 comment

  1. Can you please define global $post; after check it?

    For example :

    function display_slogan_element() {
        global $post;
        $editor_id = "home_slogan";
        $editor_class = "slogan";
        $textarea_name = "slogan";
        $content = get_post_meta( $post->ID, 'slogan', true);
        $settings = array('teeny'=> TRUE);
    
        wp_editor( $content, $editor_id, $settings = array() );
    
    }
    

Comments are closed.