Skip to content

Instantly share code, notes, and snippets.

@abachuk
Last active December 12, 2015 02:58
Show Gist options
  • Save abachuk/4703394 to your computer and use it in GitHub Desktop.
Save abachuk/4703394 to your computer and use it in GitHub Desktop.
meta box code example
$meta_boxes[] = array(
'id' => 'home_page_metabox2',
'title' => 'Preview',
'pages' => array( 'page', ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
'show_on' => array( 'key' => 'page-template', 'value' => 'page_home.php' ),
'fields' => array(
array(
'name' => 'Preview Title',
//'desc' => 'field description (optional)',
'id' => $prefix . 'preview_title',
'type' => 'text',
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment