Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Last active May 19, 2016 00:00
Show Gist options
  • Save atwellpub/9b43a60f000bfea78297 to your computer and use it in GitHub Desktop.
Save atwellpub/9b43a60f000bfea78297 to your computer and use it in GitHub Desktop.
calls to action, cta
<?php //remove me
$wp_cta_data[$key]['settings'] =
array(
array(
'label' => 'Instructions', // Name of field
'description' => "This is a demo template for developers and designers to learn how to create your own call to action templates. View the source inside /wp-content/plugins/cta/templates/demo for more info", // what field does
'id' => 'description', // metakey. $key Prefix is appended from parent in array loop
'type' => 'description-block', // metafield type
'default' => '', // default content
'context' => 'normal' // Context in screen (advanced layouts in future)
),
/* Text field Example */
array(
'label' => 'Text Field Label', // Label of field
'description' => "Text field Description", // field description
'id' => 'text_box_id', // metakey. The $key Prefix is appended making the meta value demo-text-box-id
'type' => 'text', // text metafield type
'default' => 'Text in box', // default content
'context' => 'normal' // Context in screen for organizing options
),
/* Textarea Example */
array(
'label' => 'Textarea Label',
'description' => "Textarea description to the user",
'id' => 'textarea_id', // called in template's index.php file with lp_get_value($post, $key, 'textarea-id');
'type' => 'textarea',
'default' => 'Default text in textarea',
'context' => 'normal'
),
/* Colorpicker Example */
array(
'label' => 'ColorPicker Label',
'description' => "Colorpicker field description",
'id' => 'color_picker_id', // called in template's index.php file with lp_get_value($post, $key, 'color-picker-id');
'type' => 'colorpicker',
'default' => 'ce1010',
'context' => 'normal'
),
/* Radio Button Example */
array(
'label' => 'Radio Label',
'description' => "Radio field description",
'id' => 'radio_id_here', // called in template's index.php file with lp_get_value($post, $key, 'radio-id-here');
'type' => 'radio',
'default' => '1',
'options' => array('1' => 'on','0'=>'off'),
'context' => 'normal'
),
/* Checkbox Example */
array(
'label' => 'Checkbox Label',
'description' => "Example Checkbox Description",
'id' => 'checkbox_id_here', // called in template's index.php file with lp_get_value($post, $key, 'checkbox-id-here');
'type' => 'checkbox',
'default' => 'on',
'options' => array('option_on' => 'on'),
'context' => 'normal'
),
/* Dropdown Example */
array(
'label' => 'Dropdown Label',
'description' => "Dropdown option description",
'id' => 'dropdown_id_here', // called in template's index.php file with lp_get_value($post, $key, 'dropdown-id-here');
'type' => 'dropdown',
'default' => 'default',
'options' => array('right'=>'Float right','left'=>'Float left', 'default'=>'Default option'),
'context' => 'normal'
),
/* Date Picker Example */
array(
'label' => 'Date Picker Label',
'description' => "Date Picker Description",
'id' => 'date_picker', // called in template's index.php file with lp_get_value($post, $key, 'date-picker');
'type' => 'datepicker',
'default' => '2013-12-27',
'context' => 'normal'
),
/* WYSIWYG Example */
array(
'label' => 'Main Content Box 2',
'description' => "wysiwyg description",
'id' => 'wysiwyg_id', // called in template's index.php file with lp_get_value($post, $key, 'wysiwyg-id');
'type' => 'wysiwyg',
'default' => 'Default WYSIWYG content',
'context' => 'normal'
),
/* Media Uploaded Example */
array(
'label' => 'File/Image Upload Label',
'description' => "File/Image Upload Description",
'id' => 'media_id', // called in template's index.php file with lp_get_value($post, $key, 'media-id');
'type' => 'media',
'default' => 'http://www.fillmurray.com/200/300',
'context' => 'normal'
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment