Created
January 3, 2013 19:17
-
-
Save WagnerMatos/4446166 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Wrap all categories in a function | |
function wcat2() { | |
$out = array(); | |
$categories = get_categories(); | |
foreach( $categories as $category ) { | |
$out[$category->term_id] = array( | |
'label' => $category->slug, | |
'value' => $category->term_id | |
); | |
} | |
return $out; | |
} | |
With the code below we'll create the custom meta box: | |
// Add the Meta Box | |
function home_custom_meta_box() { | |
add_meta_box( | |
'home_meta_box', // $id | |
'Custom Meta Box', // $title | |
'home_show_custom_meta_box', // $callback | |
'page', // $page | |
'normal', // $context | |
'high'); // $priority | |
} | |
add_action('add_meta_boxes', 'home_custom_meta_box'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment