Skip to content

Instantly share code, notes, and snippets.

@wpmark
Created December 1, 2014 18:36
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 wpmark/8d96847316d5f46a6174 to your computer and use it in GitHub Desktop.
Save wpmark/8d96847316d5f46a6174 to your computer and use it in GitHub Desktop.
Add Additional Fields to WP Post Type Meta
<?php
function wpptm_add_select_input( $settings ) {
/* add our setting to the settings array */
$settings[] = array(
'type'=> 'select',
'label'=> 'A Select Box',
'id'=> ‘selectbox’,
'options' = array(
array(
'name' => 'Display Name One',
'value' => '1'
),
array(
'name' => 'Display Name Two',
'value' => '2'
)
)
'class'=> 'select_box_css_class'
);
/* return the modified settings array */
return $settings;
}
add_filter( 'wpptm_settings', 'wpptm_add_select_input', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment