You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding FM fields above the WP main content editor is a fairly simple process that can be broken down into three basic steps:
Render the meta boxes to appear in some uniquely defined context--(uniquely defined context as in not'normal', 'side', or 'advanced'). Here, 'ai_after_title' is used.
unset the unique context from $wp_meta_boxes['post'].
Set the $context argument of any $fm->add_meta_box() calls to match the unique context from above.
The hook, edit_form_after_title is used to achieve the first and second steps.
Set up the context:
functionai_edit_form_after_title() {
// get globals varsglobal$post, $wp_meta_boxes;
// render the FM meta box in 'ai_after_title' contextdo_meta_boxes( get_current_screen(), 'ai_after_title', $post );
// unset 'ai_after_title' context from the post's meta boxes
unset( $wp_meta_boxes['post']['ai_after_title'] );
}
add_action( 'edit_form_after_title', 'ai_edit_form_after_title' );