• Resolved saurabhd

    (@saurabhd)


    I am working in a plugin and in that plugin adding wordpress default editor(wp_editor)and adding functionality to save post with add media features.

    Add media features is working absolutely fine and adding media to respective post, but i want to add image as a thumbnail but i am not able to add set featured image button to the add media button.

    This is the code i am writing to add WordPress default editor:-
    wp_editor( $post_content , ‘productinfoeditor’, array(‘media_uploads’=>true,’textarea_name’ => ‘product_info_content’, ‘editor_class’ => ‘requiredField’, ‘teeny’ => true, ‘textarea_rows’ => 14) );

    In function.php file-
    add_theme_support( ‘post-thumbnails’, array(‘post’,’page’, ‘product’ ) );

    And saving post with:-
    $post = array();
    $post[‘post_type’] = ‘product’;
    $post[‘post_content’] = $product_info_content;
    $post[‘post_author’] = $user_ID;
    $post[‘post_status’] = ‘publish’;
    $post[‘post_title’] = $product_title;
    $post_id = wp_insert_post( $post );
    ======
    Please guys help me to fix it 🙂
    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add set featured image button in wp_editor() ?’ is closed to new replies.