Skip to content

Instantly share code, notes, and snippets.

View sbruner's full-sized avatar

Steve Bruner sbruner

View GitHub Profile
@sbruner
sbruner / piklist-field-text.php
Created January 18, 2016 02:30
Piklist: field: text
<?php
piklist('field', array(
'type' => 'text',
'field' => 'my_text',
'label' => 'Text',
'attributes' => array(
'class' => 'regular-text' // WordPress css class
)
@sbruner
sbruner / piklist-field-radio.php
Created January 18, 2016 02:24
Piklist: field: radio
<?php
piklist('field', array(
'type' => 'radio',
'field' => 'my_radio',
'label' => 'Radio',
'choices' => array(
'first' => 'First Choice',
,'second' => 'Second Choice',
@sbruner
sbruner / piklist-field-editor-basic.php
Created January 18, 2016 01:53
Piklist: field: editor: basic
<?php
piklist('field', array(
'type' => 'editor',
'field' => 'my_editor_field',
'label' => 'Post Content'
));
?>
@sbruner
sbruner / piklist-field-editor-replace-default.php
Last active January 18, 2016 01:57
Piklist: field: editor: replace default
<?php
piklist('field', array(
'type' => 'editor',
'field' => 'post_content', // This is the field name of the WordPress default editor
'scope' => 'post', // Save to the wp_post table
'label' => 'Post Content',
'template' => 'field', // Only display the field not the label
'options' => array( // Pass any option that is accepted by wp_editor()
@sbruner
sbruner / piklist-field-datepicker-localize.php
Created January 17, 2016 04:28
Piklist: field: datepicker localize
<?php
piklist('field', array(
'type' => 'datepicker',
'field' => 'my_date_field',
'label' => 'Date',
'options' => array(
'closeText'=>'Fermer',
'prevText'=>'Précédent',
@sbruner
sbruner / piklist-field-datepicker.php
Last active January 17, 2016 04:27
Piklist: field: datepicker
<?php
piklist('field', array(
'type' => 'datepicker',
'field' => 'my_date_field',
'label' => 'Date',
'value' => date('M d, Y', time() + 604800), // set default value
'options' => array(
'dateFormat' => 'M d, yy'
@sbruner
sbruner / piklist-field-colorpicker.php
Last active January 17, 2016 04:16
Piklist: field: colorpicker
<?php
piklist('field', array(
'type' => 'colorpicker',
'field' => 'my_color',
'label' => 'Color Picker'
));
?>
@sbruner
sbruner / piklist-field-checkbox.php
Created January 16, 2016 03:51
Piklist: field: checkbox
<?php
piklist('field', array(
'type' => 'checkbox',
'field' => 'checkbox',
'label' => 'Checkbox',
'value' => 'third', // set default value
'choices' => array(
'first' => 'First Choice',
@sbruner
sbruner / piklist-field-hidden.php
Last active January 16, 2016 03:45
Piklist: field: hidden
<?php
piklist('field', array(
'type' => 'hidden',
'field' => 'post_id',
'value' => $post->ID // set the value of this hidden field to the Post ID.
));
?>
@sbruner
sbruner / piklist-field-select.php
Last active December 12, 2016 18:34
Piklist: field: select
<?php
piklist('field', array(
'type' => 'select',
'field' => 'my_select',
'label' => 'My select',
'choices' => array(
'first' => 'First Choice',
'second' => 'Second Choice',