This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Display dynamic html markup in a textarea for easy copying and pasting --> | |
<!-- start object buffering --> | |
<?php ob_start(); ?> | |
<!-- create your template --> | |
<!-- Use the get_post_meta() function to get your data --> | |
<table style="width:100%"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_custom_init() { | |
remove_post_type_support( 'post', 'custom-fields' ); | |
} | |
add_action( 'init', 'my_custom_init' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
piklist('field', array( | |
type' => 'url' // HTML5 url field | |
,'field' => 'my_url' | |
,'template' => 'field' | |
,'attributes' => array( | |
'class' => 'regular-text' | |
) | |
)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// required with Piklist | |
piklist('field', array( | |
'type' => 'text' | |
,'field' => 'text_required' | |
,'label' => 'Enter some required text' | |
,'required' => true | |
)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Demonstrates a lot of conditional fields working together | |
// Show this field if (guest_meal == steak) or (guest_one_meal == steak) or (guest_two_meal == steak) | |
piklist('field', array( | |
'type' => 'html' | |
,'field' => '_message_meal' | |
,'value' => __('We only serve steaks rare.', 'piklist-demo') | |
,'attributes' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Movable Type has never been Free Software, as defined by the Free Software | |
Foundation. It has never been open source software, as defined by the Open | |
Source Initiative. Six Apart survived and thrived in the blogging community | |
because Movable Type was “free enough.” | |
… | |
Many people misunderstand | |
Free Software and the GNU General Public License. Many people equate the GPL to | |
the boogeyman, because it’s “viral”, and that sounds like a bad thing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_add_sub_title() { | |
piklist('field', array( | |
'type' => 'text' | |
,'field' => 'text' | |
,'template' => 'field' // format the field without a label | |
,'attributes' => array( | |
'class' => 'large-text' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('piklist_taxonomies', 'demo_type_tax'); | |
function demo_type_tax($taxonomies) { | |
$taxonomies[] = array( | |
'post_type' => 'piklist_demo' | |
,'name' => 'piklist_demo_type' | |
,'show_admin_column' => true | |
,'configuration' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//When the user enters data in the piklist_demo_fields settings page and they press save, add another setting called option_key with the value of option_value. | |
add_filter('piklist_pre_update_option_piklist_demo_fields','my_update_option',10,4); | |
function my_update_option($settings, $setting, $new, $old) { | |
$settings['option_key'] = 'option_value'; | |
return $settings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//When the user enters data in the piklist_demo_fields settings page and they press save, add another setting called option_key with the value of option_value. | |
add_filter('piklist_pre_update_option','my_update_option',10,4); | |
function my_update_option($settings, $new, $old) { | |
if ($setting == 'piklist_demo_fields') { | |
$settings['option_key'] = 'option_value'; | |
} |