Skip to content

Instantly share code, notes, and snippets.

@carlodaniele
Last active February 7, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlodaniele/e14d4231f3c344953681 to your computer and use it in GitHub Desktop.
Save carlodaniele/e14d4231f3c344953681 to your computer and use it in GitHub Desktop.
Add meta box callback function
<?php
/**
* Add meta box
*
* @param post $post The post object
* @link https://codex.wordpress.org/Plugin_API/Action_Reference/add_meta_boxes
*/
function food_add_meta_boxes( $post ){
add_meta_box( 'food_meta_box', __( 'Nutrition facts', 'food_example_plugin' ), 'food_build_meta_box', 'food', 'side', 'low' );
}
add_action( 'add_meta_boxes_food', 'food_add_meta_boxes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment