Skip to content

Instantly share code, notes, and snippets.

@scofennell
Last active August 29, 2015 14:01
Show Gist options
  • Save scofennell/907a26bd45f5e7cd7a9f to your computer and use it in GitHub Desktop.
Save scofennell/907a26bd45f5e7cd7a9f to your computer and use it in GitHub Desktop.
Return a multi-dimensional array for managing WordPress custom post meta
<?php
/**
* Return a multi-dimensional array for managing custom post meta
*
* @return array An multi-dimensional associative array for drawing & saving post meta fields.
*/
function sjf_deh_meta_fields() {
$sjf_deh_meta_fields = array(
array(
'label' => 'Vertical Position',
'desc' => 'To which edge of the window should the bg image attach?',
'id' => 'sjf_deh_vertical_position',
'type' => 'select',
'options' => array( 'center', 'top', 'bottom' ),
),
array(
'label' => 'Horiziontal Position',
'desc' => 'To which side of the window should the bg image attach?',
'id' => 'sjf_deh_horizontal_position',
'type' => 'select',
'options' => array( 'center', 'left', 'right' ),
),
array(
'label' => 'Background Size',
'desc' => 'How should the image be sized against the window?',
'id' => 'sjf_deh_background_size',
'type' => 'select',
'options' => array( 'cover', 'contain' ),
),
);
return $sjf_deh_meta_fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment