Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 );
share|improve this question
add comment

1 Answer 1

Your product post type should have support for thumbnail. See the codex for more info on supports.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.