Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Created August 21, 2011 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Tmeister/1161119 to your computer and use it in GitHub Desktop.
Save Tmeister/1161119 to your computer and use it in GitHub Desktop.
WordPress MetaBox
<?php
add_action( 'add_meta_boxes', 'add_custom_box', 1);
function add_custom_box()
{
add_meta_box(
'id_box',
"Title Box",
'inner_custom_box'),
'post',
'side'
);
}
function inner_custom_box( $post )
{
wp_nonce_field( plugin_basename( __FILE__ ), 'plugin_noncename' );
?>
<p>Field</p>
<input type="text" name="custom-data" />
<?
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment