I am working on theme development and I have to move my featured image metabox so that it is more user friendly. I searched for move featured image metabox.
Thanks Allah for I have found the solution
For a test I found that the problem is that it works for "post" post type not custom post type
# Information
WP version: 5.0.3 PHP version: 7.2.11 I am using Laragon
# This is the code
add_action('do_meta_boxes', 'ppdc_screenshot_move_metabox' );
function ppdc_screenshot_move_metabox() {
remove_meta_box( 'postimagediv', 'ppdc-screenshot', 'side' );
add_meta_box('postimagediv', 'Screenshot Image', 'post_thumbnail_meta_box', 'ppdc-screenshot', 'normal', 'high');
}
I am working on theme development and I have to move my featured image metabox so that it is more user friendly. I searched for move featured image metabox.
Thanks Allah for I have found the solution
For a test I found that the problem is that it works for "post" post type not custom post type
# Information
WP version: 5.0.3 PHP version: 7.2.11 I am using Laragon
# This is the code
add_action('do_meta_boxes', 'ppdc_screenshot_move_metabox' );
function ppdc_screenshot_move_metabox() {
remove_meta_box( 'postimagediv', 'ppdc-screenshot', 'side' );
add_meta_box('postimagediv', 'Screenshot Image', 'post_thumbnail_meta_box', 'ppdc-screenshot', 'normal', 'high');
}
Hope this code may be help you.
You can read the full parameters for add_meta_box in the codex. I also listed them here:
add_meta_box( $id, $title, $callback, $page, $context, $priority, $callback_args );
function wpt_add_event_metaboxes() {
add_meta_box(
'wpt_events_location', // $id
'Event Location', // $title
'wpt_events_location', // $callback
'events', // $page (Post Type)
'side', // $context
'default' // $priority
);
}
add_action( 'add_meta_boxes', 'wpt_add_event_metaboxes' );
For the example above: