Skip to content

Instantly share code, notes, and snippets.

@soderlind-gist
soderlind-gist / remove_comments_are_closed.php
Created January 15, 2013 20:12
WordPress:Remove comments are closed
add_filter('gettext', 'ps_remove_comments_are_closed', 20, 3);
function ps_remove_comments_are_closed($translated_text, $untranslated_text, $domain) {
if ( $untranslated_text == 'Comments are closed.' ) {
return '';
}
return $translated_text;
}
@soderlind-gist
soderlind-gist / gist:4543608
Created January 16, 2013 00:42
piklist:checkbox
piklist( 'field', array(
'type' => 'checkbox'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'value' => 'option2' // Sets default to Option 2
, 'label' => 'Example Field'
, 'description' => 'Field Description'
, 'attributes' => array(
'class' => 'text'
)
@soderlind-gist
soderlind-gist / gist:4543611
Created January 16, 2013 00:43
piklist:colorpicker
piklist( 'field', array(
'type' => 'colorpicker'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'label' => 'Example Field'
, 'description' => 'Click in box'
, 'attributes' => array(
'class' => 'text'
)
) );
@soderlind-gist
soderlind-gist / gist:4543616
Created January 16, 2013 00:43
piklist:datepicker
piklist( 'field', array(
'type' => 'datepicker'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'label' => 'Example Field'
, 'description' => 'Click in box'
, 'attributes' => array(
'class' => 'text'
)
, 'options' => array(
@soderlind-gist
soderlind-gist / gist:4543619
Created January 16, 2013 00:43
piklist:textarea
piklist( 'field', array(
'type' => 'textarea'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'label' => 'Example Field'
, 'description' => 'Field Description'
, 'attributes' => array(
'class' => 'text'
)
) );
@soderlind-gist
soderlind-gist / gist:4543621
Created January 16, 2013 00:44
piklist:radio
piklist( 'field', array(
'type' => 'radio'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'value' => 'option2' // Sets default to Option 2
, 'label' => 'Example Field'
, 'description' => 'Field Description'
, 'attributes' => array(
'class' => 'text'
)
@soderlind-gist
soderlind-gist / gist:4543627
Created January 16, 2013 00:44
piklist:select
piklist( 'field', array(
'type' => 'select'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'value' => 'option2' // Sets default to Option 2
, 'label' => 'Example Field'
, 'description' => 'Field Description'
, 'attributes' => array(
'class' => 'text'
)
@soderlind-gist
soderlind-gist / gist:4543632
Created January 16, 2013 00:45
piklist:timepicker
piklist( 'field', array(
'type' => 'timepicker'
, 'field' => 'time'
, 'label' => 'Time'
, 'description' => 'Choose a time'
, 'options' => array(
'startTime' => date( 'H:m A' )
, 'show24Hours' => false
, 'separator' => ':'
, 'step' => 15
@soderlind-gist
soderlind-gist / gist:4543650
Last active December 11, 2015 04:18
piklist:text
piklist( 'field', array(
'type' => 'text'
, 'scope' => 'post_meta' // Not used for settings sections
, 'field' => 'field_name'
, 'label' => 'Example Field'
, 'description' => 'Field Description'
, 'attributes' => array(
'class' => 'text'
)
) );
@soderlind-gist
soderlind-gist / gist:4554293
Created January 17, 2013 07:17
piklist:header
/*
Title: My Settings Section
Setting: piklist-examples
Tab: Advanced
Order: 20
*/