I created a custom post type outside the wordpress loop. I want to integrate the featured image meta box in the backend for this post type.
$this->add_meta_box(‘postimagediv’,’Beitragsbild’, array($this, ‘featured_image_meta_box’), ‘side’);
which calls the wordpress core function:
protected function add_meta_box($id, $title, $callback, $context = ‘normal’, $priority = ‘default’, $callback_args = null ) {
add_meta_box( ‘product_db_’ . Kickoff::$action . ‘_’ . $id, $title, $callback, null, $context, $priority, $callback_args);
}
the meta box works, but if i click on add image, it opens an iframe which calls media-upload.php but i want it to look like the normal wordpress mediagalery function like on create posts. This iframe calls the admin-ajax.php.
Does anyone have any idea what i have to change/call in addition to make the iframe work with the default ajax mediagalery?
Read more here:: featured image in custom poste type (backend)