I have this function that creates a custom metabox (with the metabox .io plugin), i would like the metabox to stay on top just below the title field

this is the code i am using

function generator_api() {
    'generator_api', esc_html__( 'Generator', 'moviewp' ),
    'high' );
function generator_api_form() {
<div class="rwmb-meta-box">
    <div class="rwmb-field rwmb-text-wrapper">
        <div id="Generator" class="postbox rwmb-default">
            <input type="text" id="term" class="textInput" autocomplete="off" placeholder="Search...">
            <div id="major-publishing-actions" style="overflow:hidden">
                <div id="publishing-action" class="fetch-details">
                    <span class="culo">
                        <span id="hideme">
                            <input type="radio" name="test" value="movie" required="" checked="">
                            <span id="film"><?php echo esc_html__( 'Movie', 'moviewp' ) ?></span>
                            <input id="TV" type="radio" name="test" value="tv">
                            <span id="TV"><?php echo esc_html__( 'TV', 'moviewp' ) ?></span>
                            <span id="movieform">
                                <input title="fetchm" class="rwmb-text" placeholder="IMDb ID" type="text" id="fetchm" name="fetchm" value="">
                                <input type="button" class="button button-primary" id="fetchmovie" name="fetchmovie" value="Movie">
                            <span id="tvform" class="hide">
                                <input title="fetcht" class="rwmb-text" placeholder="TMDB ID" type="text" id="fetcht" name="fetcht" value="">
                                <input type="button" id="fetchtv" class="button button-primary" name="fetchtv" value="TV">
                    <span id="publishme"></span>
                    <span id="api_status">
                        <i class="fa fa-circle rotondo"></i><?php echo esc_html__( 'API is online', 'moviewp' ) ?>
                    <div id="message"></div>
            <ul id="pagination"></ul>
add_action( 'add_meta_boxes', 'generator_api' );

Found the solution :)

add_action('edit_form_after_title', function() {
    global $post, $wp_meta_boxes;
    do_meta_boxes(get_current_screen(), 'advanced', $post);
add_action('add_meta_boxes', 'generator_api');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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