arrow_back
Back

WordPress meta boxes: add_meta_box, save_post, and post meta

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

To add a new meta box:

function fairways_upload_dates_box() {
    $screens = [ 'post' ];
    foreach ( $screens as $screen ) {
        add_meta_box(
            'fairways_upload_dates_box',
            'Availability dates',
            'fairways_upload_dates_box_html',
            $screen
        );
    }
}
add_action( 'add_meta_boxes', 'fairways_upload_dates_box' );

function fairways_upload_dates_box_html( $post ) {
    echo "Your form is here";
}
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

WordPress taxonomies: register_taxonomy, terms, categories, and tags

arrow_forward