/** * Post Type: location */ function fwe_register_post_type_location($post_types) { $labels = piklist('post_type_labels', 'Locations'); $labels['name'] = 'Locations'; $post_types['location'] = array('labels' => $labels, 'title' => 'Enter Location Name...', 'public' => true, 'menu_icon' => 'dashicons-location-alt', 'exclude_from_search' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'rewrite' => array('slug' => 'location'), 'supports' => array('title', 'thumbnail')); return $post_types; }
public static function restore_revision($post_id, $revision_id) { $meta = piklist('post_custom', $revision->ID); foreach ($meta as $key => $value) { update_metadata('post', $post_id, $key, $value); } }
public static function getLabels() { if (!function_exists('piklist')) { // TODO some error or defaults } $labels = piklist('post_type_labels', ucwords(str_replace('-', ' ', static::getPostType()))); if (isset(static::$labels)) { return array_merge($labels, static::$labels); } return $labels; }
public static function renderField(Property $property) { $description = (string) $property->getDescription(); $settings = ['type' => static::getFieldType($property), 'field' => $property->getVariableName(), 'label' => static::removeJson($description), 'columns' => '12', 'attributes' => ['class' => 'text']]; $isCollection = static::isCollection($property); if ($isCollection) { $settings['add_more'] = true; } $isScoped = static::isScopedRelationship($property); if ($isScoped) { $variableName = $property->getVariableName(); $settings['scope'] = static::$object->getFieldType($variableName)->getScope(); } $hasJson = static::hasJsonString((string) $description); if ($hasJson) { $settings = wp_parse_args($hasJson, $settings); } piklist('field', $settings); }
<?php /* Title: Extend Piklist Setting: piklist_core_addons Tab Order: 0 */ ?> <p> <?php _e('Add-ons are Piklist plugins that are included with Piklist core, or another Piklist plugin. They allow you to turn on additional functionality.', 'piklist'); ?> </p> <?php piklist('field', array('type' => 'add-ons', 'field' => 'add-ons', 'template' => 'field', 'label' => __('Plugin Add-ons', 'piklist'), 'choices' => piklist(piklist_add_on::$available_add_ons, array('_key', 'Name'))));
<?php /* Title: Agency Partners Setting: agency_settings Tab: Partners Flow: Options */ piklist('field', array('type' => 'select', 'field' => 'setting_partners_display', 'label' => __('Display Partners Section', 'sage'), 'value' => 'FALSE', 'choices' => array('TRUE' => __('Yes', 'sage'), 'FALSE' => __('No', 'sage')))); $partner_name = array('type' => 'text', 'field' => 'partner_name', 'label' => __('Partner Name', 'sage'), 'attributes' => array('class' => 'regular-text', 'placeholder' => __('Enter the partner name', 'sage'))); $partner_website = array('type' => 'text', 'field' => 'partner_website', 'label' => __('Partner Website', 'sage'), 'attributes' => array('class' => 'regular-text', 'placeholder' => __('Enter the partner website', 'sage')), 'validate' => array(array('type' => 'url'))); $partner_logo = array('type' => 'file', 'field' => 'partner_logo', 'label' => __('Partner Logo', 'sage'), 'options' => array('modal_title' => __('Add Logo', 'sage'), 'button' => __('Add Logo', 'sage'))); piklist('field', array('type' => 'group', 'field' => 'agency_partners', 'label' => __('Partners', 'sage'), 'add_more' => true, 'fields' => array($partner_name, $partner_website, $partner_logo)));
** Voyage Flight Section *******************************************************************************/ $flight_airline = array('type' => 'text', 'field' => 'flight_airline', 'columns' => 4, 'label' => __('Airline', 'sage')); $flight_number = array('type' => 'text', 'field' => 'flight_number', 'columns' => 4, 'label' => __('Flight number', 'sage')); $flight_class = array('type' => 'select', 'field' => 'flight_class', 'label' => __('Flight Class', 'sage'), 'columns' => 4, 'value' => 'economy', 'choices' => array('economy' => __('Economy', 'sage'), 'business' => __('Business', 'sage'), 'first' => __('First', 'sage'))); $flight_departure_city = array('type' => 'text', 'field' => 'flight_departure_city', 'columns' => 6, 'label' => __('Departure city', 'sage')); $flight_arrival_city = array('type' => 'text', 'field' => 'flight_arrival_city', 'columns' => 6, 'label' => __('Arrival city', 'sage')); $flight_departure_date = array('type' => 'datepicker', 'field' => 'flight_departure_date', 'columns' => 3, 'label' => __('Departure date', 'sage'), 'options' => array('dateFormat' => 'dd/mm/yy')); $flight_departure_time = array('type' => 'time', 'field' => 'flight_departure_time', 'columns' => 3, 'label' => __('Departure time', 'sage')); $flight_arrival_date = array('type' => 'datepicker', 'field' => 'flight_arrival_date', 'columns' => 3, 'label' => __('Arrival date', 'sage'), 'options' => array('dateFormat' => 'dd/mm/yy')); $flight_arrival_time = array('type' => 'time', 'field' => 'flight_arrival_time', 'columns' => 3, 'label' => __('Arrival time', 'sage')); $flight_comments = ['type' => 'text', 'field' => 'flight_comments', 'label' => __('Comments', 'sage'), 'attributes' => ['placeholder' => __('Comments', 'sage')], 'columns' => 12]; $flights = array('type' => 'group', 'field' => 'flights_group', 'label' => __('Flights', 'sage'), 'add_more' => true, 'fields' => array($flight_airline, $flight_number, $flight_class, $flight_departure_city, $flight_arrival_city, $flight_departure_date, $flight_departure_time, $flight_arrival_date, $flight_arrival_time, $flight_comments)); /******************************************************************************* ** Voyage Accommodation Section *******************************************************************************/ $host_name = ['type' => 'text', 'field' => 'establishment_name', 'label' => __('Establishment name', 'sage'), 'columns' => 6]; $host_type = ['type' => 'select', 'field' => 'establishment_type', 'label' => __('Establishment type', 'sage'), 'columns' => 4, 'choices' => array('hotel' => __('Hotel', 'sage'), 'b&b' => __('Bed & Breakfast', 'sage'), 'residence' => __('Residence', 'sage'), 'airbnb' => __('Airbnb', 'sage'), 'private' => __('Private apartment', 'sage'), 'hostel' => __('Hostel', 'sage'))]; $host_rating = array('type' => 'select', 'field' => 'establishment_rating', 'label' => __('Rating', 'sage'), 'columns' => 2, 'choices' => array('5' => __('5 Stars', 'sage'), '4' => __('4 Stars', 'sage'), '3' => __('3 Stars', 'sage'), '2' => __('2 Stars', 'sage'), '1' => __('1 Star', 'sage'))); $host_checkin_date = array('type' => 'datepicker', 'field' => 'establishment_checkin_date', 'label' => __('Check-in date', 'sage'), 'columns' => 3, 'options' => array('dateFormat' => 'd/m/yy')); $host_checkin_time = array('type' => 'time', 'field' => 'establishment_checkin_time', 'label' => __('Check-in time', 'sage'), 'columns' => 3); $host_checkout_date = array('type' => 'datepicker', 'field' => 'establishment_checkout_date', 'label' => __('Check-out date', 'sage'), 'columns' => 3, 'options' => array('dateFormat' => 'd/m/yy')); $host_checkout_time = array('type' => 'time', 'field' => 'establishment_checkout_time', 'label' => __('Check-out time', 'sage'), 'columns' => 3); $host_gallery = ['type' => 'file', 'field' => 'establishment_gallery', 'label' => __('Photo Gallery', 'sage')]; $host_comments = array('type' => 'textarea', 'field' => 'establishment_comments', 'label' => __('Comments & Description', 'sage'), 'columns' => 12); $accomodations = array('type' => 'group', 'field' => 'accomodations_group', 'label' => __('Accomodations', 'sage'), 'add_more' => true, 'fields' => array($host_name, $host_type, $host_rating, $host_checkin_date, $host_checkin_time, $host_checkout_date, $host_checkout_time, $host_gallery, $host_comments)); /** * Estimate Group */ piklist('field', array('type' => 'group', 'field' => 'estimate_voyages', 'template' => 'field', 'label' => __('Voyages', 'sage'), 'add_more' => true, 'fields' => array($title, $people, $number_days, $number_nights, $price, $currency, $expiry_date, $slogan, $conditions, $photos, $flights, $accomodations)));
<?php /* Width: 720 */ piklist('field', array('type' => 'text', 'field' => 'text_class_small', 'label' => 'Text', 'value' => 'Lorem', 'help' => 'You can easily add tooltips to your fields with the help parameter.', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'text_columns_element', 'label' => 'Columns Element', 'description' => 'columns="6"', 'value' => 'Lorem', 'columns' => 6)); piklist('field', array('type' => 'text', 'field' => 'text_add_more', 'add_more' => true, 'label' => 'Text Add More', 'description' => 'add_more="true"', 'value' => 'Lorem')); piklist('field', array('type' => 'number', 'field' => 'number', 'label' => 'Number', 'description' => 'ipsum dolor sit amet, consectetur adipiscing elit.', 'value' => 5, 'attributes' => array('class' => 'small-text', 'step' => 1, 'min' => 0, 'max' => 10))); piklist('field', array('type' => 'textarea', 'field' => 'demo_textarea_large', 'label' => 'Large Code', 'description' => 'class="large-text code" rows="10" columns="50"', 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'attributes' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'))); piklist('field', array('type' => 'file', 'field' => 'upload_media', 'label' => __('Add File(s)', 'piklist-demo'), 'description' => __('This is the uploader seen in the admin by default.', 'piklist-demo'), 'options' => array('modal_title' => __('Add File(s)', 'piklist-demo'), 'button' => __('Add', 'piklist-demo')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 2))))); piklist('field', array('type' => 'group', 'field' => 'slides', 'add_more' => true, 'label' => 'Slide Images', 'description' => 'Add the slides for the slideshow. You can add as many slides as you want, and they can be drag-and-dropped into the order that you would like them to appear.', 'fields' => array(array('type' => 'file', 'field' => 'image', 'label' => __('Slides', 'plugin'), 'columns' => 12), array('type' => 'text', 'field' => 'url', 'label' => 'URL', 'columns' => 12)))); piklist('field', array('type' => 'group', 'field' => 'slides_basic', 'add_more' => true, 'label' => 'Slide Images', 'description' => 'Add the slides for the slideshow. You can add as many slides as you want, and they can be drag-and-dropped into the order that you would like them to appear.', 'fields' => array(array('type' => 'file', 'field' => 'image', 'label' => __('Slides', 'plugin'), 'columns' => 12, 'options' => array('basic' => true)), array('type' => 'text', 'field' => 'url', 'label' => 'URL', 'columns' => 12))));
function cpt_franchise_taxo($taxonomies) { $taxonomies[] = array('post_type' => 'franchise', 'name' => 'segments', 'show_admin_column' => true, 'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png'), 'configuration' => array('hierarchical' => true, 'labels' => piklist('taxonomy_labels', 'Segments'), 'show_admin_column' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => 'segments'))); $taxonomies[] = array('post_type' => 'franchise', 'name' => 'locations', 'show_admin_column' => true, 'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png'), 'configuration' => array('hierarchical' => true, 'labels' => piklist('taxonomy_labels', 'Locations'), 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => 'locations'))); return $taxonomies; }
public static function print_pointers() { foreach (self::$pointers as $pointer => $value) { piklist('shared/pointer', array('anchor' => $value['anchor'], 'page' => $value['page'], 'content' => '<h3>' . $value['title'] . '</h3>' . $value['content'], 'edge' => $value['edge'], 'align' => $value['align'], 'pointer_id' => $value['pointer_id'])); } }
<?php /* Title: Collapsed Meta Box (Closed by default.) Post Type: piklist_demo Order: 10 Collapse: true Tab: Layout Sub Tab: Meta Boxes Flow: Demo Workflow */ piklist('field', array('type' => 'text', 'field' => 'text-meta-box-collapsed', 'label' => __('Text', 'piklist-demo')));
jobapp_duration_of_service jobapp_educational_qualifications jobapp_email_id jobapp_gender jobapp_name jobapp_name_of_the_organisation jobapp_overall_work_experience_(in_years) jobapp_preferred_work_location jobapp_professional_qualifications jobapp_role_&_responsibility resume resume_path --> <?php piklist('field', array('type' => 'text', 'field' => 'jobapp_name', 'label' => 'Name', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_contact_no_', 'label' => 'Contact No.', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_email_id', 'label' => 'Email ID', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_age', 'label' => 'Age', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_gender', 'label' => 'Gender', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_educational_qualifications', 'label' => 'Educational Qualifications', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_professional_qualifications', 'label' => 'Professional Qualifications', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_name_of_the_organisation', 'label' => 'Organisation Name', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_designation', 'label' => 'Designation', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_duration_of_service', 'label' => 'Duration of Service', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_role_&_responsibility', 'label' => 'Professional Qualifications', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_name_of_the_organisation', 'label' => 'Organisation Name', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_current_ctc', 'label' => 'Current CTC', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_overall_work_experience_(in_years)', 'label' => 'Overall Work Experience (in_years)', 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'text', 'field' => 'jobapp_preferred_work_location', 'label' => 'Preferred Work Location', 'attributes' => array('class' => 'regular-text')));
<?php /* Title: Call to Action Fields Post Type: call_to_action Context: normal Priority: high */ piklist('field', array('type' => 'text', 'field' => 'button_text', 'label' => 'Button Text', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'text', 'field' => 'link_url', 'label' => 'Link URL', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'file', 'field' => 'background_image', 'label' => 'Background Image', 'description' => 'SVG recommended', 'scope' => 'post_meta', 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))))); piklist('field', array('type' => 'colorpicker', 'field' => 'background_color', 'label' => 'Background Color', 'scope' => 'post_meta')); piklist('field', array('type' => 'text', 'field' => 'background_size', 'label' => 'Background Size', 'scope' => 'post_meta', 'description' => 'Accepts any valid CSS <code>background-size</code> value.')); piklist('field', array('type' => 'text', 'field' => 'background_position', 'label' => 'Background Position', 'scope' => 'post_meta', 'description' => 'Accepts any valid CSS <code>background-position</code> value.')); piklist('field', array('type' => 'radio', 'field' => 'background_repeat', 'label' => 'Background Repeat', 'scope' => 'post_meta', 'description' => 'Select "repeat" if the background is a repeating pattern.', 'choices' => array('repeat' => 'Repeat', 'no-repeat' => 'No Repeat')));
<?php /* Title: Team Member Details Post Type: team_member Context: normal Priority: high */ piklist('field', array('type' => 'text', 'field' => 'given_name', 'label' => 'Given (First) Name', 'help' => 'If you leave this blank, we\'ll try to guess it from the team member\'s full name.', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'text', 'field' => 'surname', 'label' => 'Surname', 'help' => 'If you leave this blank, we\'ll try to guess it from the team member\'s full name.', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'text', 'field' => 'job_title', 'label' => 'Job Title', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'text', 'field' => 'location', 'label' => 'Location', 'attributes' => array('class' => 'text'))); piklist('field', array('type' => 'text', 'field' => 'email_address', 'label' => 'Email Address', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'email'))); piklist('field', array('type' => 'text', 'field' => 'facebook', 'label' => 'Facebook', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url'))); piklist('field', array('type' => 'text', 'field' => 'twitter', 'label' => 'Twitter', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url'))); piklist('field', array('type' => 'text', 'field' => 'instagram', 'label' => 'Instagram', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url'))); piklist('field', array('type' => 'text', 'field' => 'linkedin', 'label' => 'LinkedIn', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url'))); piklist('field', array('type' => 'text', 'field' => 'pinterest', 'label' => 'Pinterest', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url'))); piklist('field', array('type' => 'text', 'field' => 'google_plus', 'label' => 'Google+', 'attributes' => array('class' => 'text'), 'validate' => array('type' => 'url')));
<?php piklist('field', array('type' => 'group', 'field' => 'address_group', 'label' => __('Address (Grouped)', 'piklist-demo'), 'list' => false, 'description' => __('A grouped field with a key set. Data is not searchable, since it is saved in an array.', 'piklist-demo'), 'fields' => array(array('type' => 'text', 'field' => 'address_1', 'label' => __('Street Address', 'piklist-demo'), 'columns' => 12, 'attributes' => array('placeholder' => 'Street Address')), array('type' => 'text', 'field' => 'address_2', 'label' => __('PO Box, Suite, etc.', 'piklist-demo'), 'columns' => 12, 'attributes' => array('placeholder' => 'PO Box, Suite, etc.')), array('type' => 'text', 'field' => 'city', 'label' => __('City', 'piklist-demo'), 'columns' => 5, 'attributes' => array('placeholder' => 'City')), array('type' => 'select', 'field' => 'state', 'label' => __('State', 'piklist-demo'), 'columns' => 4, 'choices' => piklist_demo_get_states()), array('type' => 'text', 'field' => 'postal_code', 'label' => __('Postal Code', 'piklist-demo'), 'columns' => 3, 'attributes' => array('placeholder' => 'Postal Code'))))); piklist('field', array('type' => 'group', 'field' => 'address_group_add_more', 'add_more' => true, 'label' => __('Address (Grouped/Add-More)', 'piklist-demo'), 'description' => __('A grouped field using Add-More.', 'piklist-demo'), 'fields' => array(array('type' => 'text', 'field' => 'address_1', 'label' => __('Street Address', 'piklist-demo'), 'columns' => 12), array('type' => 'text', 'field' => 'address_2', 'label' => __('PO Box, Suite, etc.', 'piklist-demo'), 'columns' => 12), array('type' => 'text', 'field' => 'city', 'label' => __('City', 'piklist-demo'), 'columns' => 5), array('type' => 'select', 'field' => 'state', 'label' => __('State', 'piklist-demo'), 'columns' => 4, 'choices' => piklist_demo_get_states()), array('type' => 'text', 'field' => 'postal_code', 'label' => __('Postal Code', 'piklist-demo'), 'columns' => 3)))); piklist('field', array('type' => 'group', 'field' => 'editor_test_one', 'label' => __('Editor test 1 with Addmore', 'piklist-demo'), 'add_more' => true, 'description' => __('A grouped/addmore field test with Editor.', 'piklist-demo'), 'fields' => array(array('type' => 'checkbox', 'field' => 'editor_test_one_checkbox', 'label' => __('Checkbox', 'piklist-demo'), 'columns' => 12, 'choices' => array('first' => __('First Choice', 'piklist-demo'), 'second' => __('Second Choice', 'piklist-demo'), 'third' => __('Third Choice', 'piklist-demo'))), array('type' => 'editor', 'field' => 'editor_test_one_editor', 'columns' => 12, 'label' => __('Post Content', 'piklist-demo'), 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'options' => array('drag_drop_upload' => true, 'editor_height' => 100, 'media_buttons' => false, 'teeny' => true, 'quicktags' => false, 'tinymce' => array('autoresize_min_height' => 100, 'toolbar1' => 'bold,italic,bullist,numlist,blockquote,link,unlink,undo,redo', 'resize' => false, 'wp_autoresize_on' => true)))))); piklist('field', array('type' => 'group', 'field' => 'editor_test_two', 'label' => __('Editor test 2 with Addmore', 'piklist-demo'), 'add_more' => true, 'description' => __('A grouped/addmore field test with Editor.', 'piklist-demo'), 'fields' => array(array('type' => 'editor', 'field' => 'editor_test_two_editor', 'columns' => 12, 'label' => __('Post Content', 'piklist-demo'), 'description' => __('This is the standard post box, now placed in a Piklist WorkFlow.', 'piklist-demo'), 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'options' => array('drag_drop_upload' => true, 'editor_height' => 100, 'media_buttons' => false, 'teeny' => true, 'quicktags' => false, 'tinymce' => array('autoresize_min_height' => 100, 'toolbar1' => 'bold,italic,bullist,numlist,blockquote,link,unlink,undo,redo', 'resize' => false, 'wp_autoresize_on' => true))), array('type' => 'checkbox', 'field' => 'editor_test_two_checkbox', 'label' => __('Checkbox', 'piklist-demo'), 'columns' => 12, 'choices' => array('first' => __('First Choice', 'piklist-demo'), 'second' => __('Second Choice', 'piklist-demo'), 'third' => __('Third Choice', 'piklist-demo')))))); piklist('shared/code-locater', array('location' => __FILE__, 'type' => 'Widget'));
<?php /* Title: Product Extra Fields Description: Add extra fields for your products Post Type: product */ piklist('field', array('type' => 'editor', 'field' => 'product_notes', 'label' => 'Additional Notes', 'template' => 'full-width', 'description' => 'Add notes specific to this product.', 'help' => 'Some instructions for this field.', 'options' => array('media_buttons' => false, 'teeny' => false, 'wpautop' => false))); piklist('field', array('type' => 'file', 'field' => 'product_images', 'label' => __('Product Photo Gallery', 'piklist'), 'template' => 'full-width', 'description' => __('Add images for your Product.', 'piklist'), 'help' => 'You should choose a multiple of 4 images. Best is 8 or 12.', 'options' => array('modal_title' => __('Add File(s)', 'piklist'), 'button' => __('Add Images', 'piklist'))));
<?php /* Title: Draggable Editor Post Type: piklist_demo,piklist_lite_demo Order: 100 */ piklist('field', array('type' => 'editor', 'field' => 'post_content_full', 'scope' => 'post', 'template' => 'field', 'value' => 'You can remove the left label when displaying the editor by defining <code>\'template\'=>\'field\'</code> in the field parameters. This will make it look like the default WordPress editor. To learn about replacing the WordPress editor <a href="http://piklist.com/user-guide/tutorials/replacing-wordpress-post-editor/">read our Tutorial</a>.', 'options' => array('wpautop' => true, 'media_buttons' => true, 'tabindex' => '', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true, 'drag_drop_upload' => true), 'on_post_status' => array('value' => 'lock')));
<?php /* Title: Dashboard Widgets Setting: piklist_wp_helpers Order: 110 Flow: WP Helpers Settings Flow */ piklist('field', array('type' => 'group', 'field' => 'remove_dashboard_widgets_new', 'label' => 'Remove Dashboard Widgets', 'fields' => array(array('type' => 'checkbox', 'field' => 'dashboard_widgets', 'choices' => piklist_wordpress_helpers::get_dashboard_widget_list(), 'columns' => 4))));
<?php /* Title: Page Background Post Type: page Context: normal Priority: high */ piklist('field', array('type' => 'group', 'field' => 'page_backgrounds', 'label' => 'Responsive Backgrounds', 'add_more' => true, 'columns' => 12, 'description' => 'When it\'s displayed as a section of a parent page, you can customize this page\'s background and text color.', 'fields' => array(array('type' => 'number', 'field' => 'min_width', 'label' => 'Minimum Window Width (in pixels)', 'description' => 'Window width in pixels. Images with higher minimum widths override lower ones.', 'columns' => 8, 'value' => 0, 'attributes' => array('min' => 0, 'max' => 1920, 'step' => 1)), array('type' => 'color', 'field' => 'background_color', 'label' => 'Background Color', 'description' => 'The background color shown behind the content. Leave blank for transparent.', 'columns' => 2, 'attributes' => array('pattern' => '#[a-fA-F0-9]{6}')), array('type' => 'color', 'field' => 'text_color', 'label' => 'Text Color', 'columns' => 2, 'value' => '#747474', 'attributes' => array('pattern' => '#[a-fA-F0-9]{6}')), array('type' => 'range', 'field' => 'color_opacity', 'label' => 'Background Color Opacity', 'columns' => 6, 'value' => 100, 'attributes' => array('min' => 0, 'max' => 100, 'step' => 1)), array('type' => 'file', 'field' => 'background_image', 'label' => 'Background Image', 'description' => 'This image will be used as the page\'s background, stretched to fill the width of the user\'s screen. For best results, use an SVG.', 'columns' => 12), array('type' => 'text', 'field' => 'background_size', 'label' => 'Background Size', 'description' => 'Supports any valid CSS value for <code>background-size</code>. This can be used to "zoom" a background image to a specific size. Leave blank for a default 1X zoom level.', 'columns' => 12), array('type' => 'text', 'field' => 'background_position', 'label' => 'Background Position', 'description' => 'Supports any valid CSS value for <code>background-position</code>. Leave blank to center the image.', 'columns' => 12), array('type' => 'radio', 'field' => 'background_repeat', 'label' => 'Background Repeat', 'description' => 'Is the background image a repeating pattern?', 'columns' => 12, 'choices' => array('repeat' => 'Repeat', 'no-repeat' => 'No Repeat')))));
<?php /* Title: Location options Description: My cool new metabox Taxonomy: location Capability: manage_options New: true Collapse: true */ // Let's create a text box field piklist('field', array('type' => 'text', 'field' => 'field_name', 'label' => __('Example Field'), 'description' => __('Field Description'), 'attributes' => array('class' => 'text')));
echo __('Error 404!', _NP_TEXT_DOMAIN); ?> </h2> <div class="clearfix"></div> <div class="post-details"> <div class="post-details--inner"> <?php echo __('Oops! Page not found. Please choose another URL.', _NP_TEXT_DOMAIN); ?> </div> </div> </div> <div class="col-md-3 sidebar"> <div class="row"> <?php piklist('common/post-sidebar'); ?> </div> </div> </div> </div> </div> <?php get_footer(); ?>
<?php /* Title: Post Submit Method: post Message: Test Entry Saved. */ // [piklist_form form="new-post-validation" add_on="piklist-demos"] piklist('field', array('type' => 'hidden', 'scope' => 'post', 'field' => 'post_type', 'value' => 'piklist_demo_entry')); piklist('field', array('type' => 'hidden', 'scope' => 'post', 'field' => 'post_status', 'value' => 'pending')); piklist('field', array('type' => 'text', 'scope' => 'post', 'field' => 'post_title', 'label' => 'Title')); piklist('field', array('type' => 'text', 'field' => 'text_required_validate', 'scope' => 'post_meta', 'label' => 'Text Required', 'description' => "required => true", 'required' => true)); piklist('field', array('type' => 'text', 'field' => 'text_limit_validate', 'scope' => 'post_meta', 'label' => 'Text Limit Validate', 'add_more' => true, 'validate' => array(array('type' => 'limit', 'options' => array('min' => 1, 'max' => 2))))); piklist('field', array('type' => 'group', 'field' => 'group_required_validate', 'scope' => 'post_meta', 'label' => 'Group Required', 'add_more' => true, 'fields' => array(array('type' => 'text', 'field' => 'name', 'columns' => 8, 'attributes' => array('placeholder' => 'Name')), array('type' => 'checkbox', 'field' => 'hierarchical_validate', 'required' => true, 'columns' => 4, 'choices' => array('true' => 'Hierarchical'))))); piklist('field', array('type' => 'text', 'label' => 'File Name', 'field' => 'file_name_validate', 'scope' => 'post_meta', 'description' => 'Converts multiple words to a valid file name', 'sanitize' => array(array('type' => 'file_name')))); piklist('field', array('type' => 'text', 'field' => 'emaildomain_validate', 'scope' => 'post_meta', 'label' => 'Email address', 'description' => __('Validate Email and Email Domain'), 'validate' => array(array('type' => 'email'), array('type' => 'email_domain')))); piklist('field', array('type' => 'text', 'field' => 'file_exists_validate', 'scope' => 'post_meta', 'label' => __('File exists?'), 'description' => 'Test with: http://wordpress.org/plugins/about/readme.txt', 'validate' => array(array('type' => 'file_exists')))); piklist('field', array('type' => 'text', 'field' => 'image_validate', 'scope' => 'post_meta', 'label' => __('Image'), 'description' => 'Test with: http://piklist.com/wp-content/themes/piklistcom-base/images/piklist-logo@2x.png', 'validate' => array(array('type' => 'image')))); piklist('field', array('type' => 'checkbox', 'field' => 'checkbox_validate', 'scope' => 'post_meta', 'label' => 'Checkbox', 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'value' => 'third', 'choices' => array('first' => 'First Choice', 'second' => 'Second Choice', 'third' => 'Third Choice'), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 2, 'max' => 2))))); piklist('field', array('type' => 'file', 'field' => 'upload_media_validate', 'scope' => 'post_meta', 'label' => __('Add File', 'piklist'), 'options' => array('modal_title' => __('Add File', 'piklist'), 'button' => __('Add', 'piklist')), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 1, 'max' => 1))))); piklist('field', array('type' => 'group', 'field' => 'address_group_add_more_validate', 'scope' => 'post_meta', 'add_more' => true, 'label' => 'Grouped/Add-More with Limit', 'description' => 'No more than 2', 'fields' => array(array('type' => 'text', 'field' => 'group_field_1', 'label' => 'Field 1', 'columns' => 12), array('type' => 'text', 'field' => 'group_field_2', 'label' => 'Field 2', 'columns' => 12)), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 1, 'max' => 2))))); piklist('field', array('type' => 'group', 'add_more' => true, 'label' => 'UnGrouped/Add-More with Limit', 'scope' => 'post_meta', 'description' => 'No more than 2', 'fields' => array(array('type' => 'text', 'field' => 'group_field_1_test', 'label' => 'Field 1', 'columns' => 12), array('type' => 'text', 'field' => 'group_field_2_test', 'label' => 'Field 2', 'columns' => 12)), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 1, 'max' => 2))))); piklist('field', array('type' => 'submit', 'field' => 'submit', 'value' => 'Submit'));
<?php /* Title: Map Settings Setting: fwe_settings Tab: Map */ piklist('field', array('type' => 'text', 'field' => 'google_maps_api_key', 'label' => 'Google Maps API Key', 'value' => 'AIzaSyBi9BiBeHzphNOXhiyaZTWdUtncrD3afdg')); piklist('field', array('type' => 'number', 'field' => 'map_zoom_level', 'label' => 'Starting Zoom Level', 'description' => 'Number between 1 and 13.', 'value' => 2, 'attributes' => array('min' => 1, 'max' => 13, 'step' => 1))); piklist('field', array('type' => 'number', 'field' => 'map_min_zoom', 'label' => 'Minimum Zoom Level', 'value' => '1', 'attributes' => array('min' => 1, 'max' => 13, 'step' => 1))); piklist('field', array('type' => 'number', 'field' => 'map_max_zoom', 'label' => 'Maximum Zoom Level', 'value' => '8', 'attributes' => array('min' => 1, 'max' => 13, 'step' => 1))); piklist('field', array('type' => 'radio', 'field' => 'map_enable_zoom', 'label' => 'Enable Zoom Controls?', 'value' => 1, 'choices' => array(1 => 'Yes', 0 => 'No'))); piklist('field', array('type' => 'text', 'field' => 'map_starting_latitude', 'label' => 'Starting Latitude', 'description' => 'Map will start centered on this point', 'value' => '42.3482')); piklist('field', array('type' => 'text', 'field' => 'map_starting_longitude', 'label' => 'Starting Longitude', 'description' => 'Map will start centered on this point', 'value' => '-75.1890'));
<?php /* Title: Accessories Post Type: product Order: 60 Collapse: true Priority: high */ $choices_array = array('' => '-- Select Accessories -- '); $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query(array('post_type' => 'page', 'posts_per_page' => 500)); $accessories = get_page_children(9, $all_wp_pages); foreach ($accessories as $accessory) { $choices_array[$accessory->ID] = $accessory->post_title; } piklist('field', ['type' => 'group', 'field' => 'accessories-group', 'description' => __('After you\'ve created a list of accessories, you can drag and drop to reorder them.'), 'add_more' => true, 'fields' => [['type' => 'select', 'label' => __('Add Accessory'), 'field' => 'accessories-product', 'choices' => $choices_array]]]);
<?php /* Title: Text Fields Post Type: piklist_demo Order: 10 Collapse: false Tab: Common Sub Tab: Basic Flow: Demo Workflow */ ?> <div class="piklist-demo-highlight"> <?php _e('Text fields are at the core of most forms, and easily created with Piklist. Tooltip help can be added to any field with one line of code.', 'piklist-demo'); ?> </div> <?php piklist('field', array('type' => 'text', 'field' => 'text', 'label' => __('Text', 'piklist-demo'), 'help' => __('You can easily add tooltips to your fields with the help parameter.', 'piklist-demo'), 'attributes' => array('class' => 'regular-text'))); piklist('field', array('type' => 'textarea', 'field' => 'demo_textarea_large', 'label' => __('Text Area', 'piklist-demo'), 'description' => 'class="large-text code" rows="10" columns="50"', 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'attributes' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text'))); piklist('shared/code-locater', array('location' => __FILE__, 'type' => 'Meta Box'));
public static function include_user_profile_fields($arguments) { global $wp_filter; $tags = array('show_user_profile', 'edit_user_profile', 'personal_options_update', 'edit_user_profile_update'); if (isset($arguments['actions'])) { foreach ($tags as $tag) { foreach ($wp_filter[$tag] as $priority => $callback) { foreach ($callback as $id => $config) { foreach ($arguments['actions'] as $action) { if (strstr($id, $action)) { $idx = _wp_filter_build_unique_id($action, $id, $priority); if ($idx == $id) { array_push($arguments['actions'], $id); } } } if (!in_array($id, $arguments['actions']) && ($wp_filter[$tag][$priority][$id]['function'][0] != 'piklist_form' && $wp_filter[$tag][$priority][$id]['function'][0] != 'save_fields')) { unset($wp_filter[$tag][$priority][$id]); } } if (empty($wp_filter[$tag][$priority])) { unset($wp_filter[$tag][$priority]); } } if (empty($wp_filter[$tag])) { unset($wp_filter[$tag]); } } } if (isset($arguments['meta_boxes'])) { $count = count(self::$meta_boxes); for ($i = 0; $i < $count; $i++) { if (!in_array(self::$meta_boxes[$i]['config']['name'], $arguments['meta_boxes'])) { unset(self::$meta_boxes[$i]); } } } piklist('shared/admin-user-profile-fields', array('meta_boxes' => isset($arguments['meta_boxes']) ? $arguments['meta_boxes'] : array())); }
<?php /* Title: Franchise Details Post Type: franchise */ piklist('field', array('type' => 'group', 'label' => 'Franchise General Details', 'list' => false, 'fields' => array(array('type' => 'text', 'field' => 'contact_person', 'label' => 'Contact Person', 'columns' => 12), array('type' => 'text', 'field' => 'franchise_code', 'label' => 'Branch Code', 'columns' => 6), array('type' => 'text', 'field' => 'franchise_address', 'label' => 'Branch Address', 'columns' => 12), array('type' => 'text', 'field' => 'franchise_postal_code', 'label' => 'Postal Code', 'columns' => 5), array('type' => 'text', 'field' => 'franchise_email', 'label' => 'Email', 'columns' => 6), array('type' => 'text', 'field' => 'franchise_phone', 'label' => 'Phone', 'columns' => 6)))); piklist('field', array('type' => 'checkbox', 'scope' => 'taxonomy', 'field' => 'segments', 'label' => 'Segments', 'columns' => 12, 'choices' => array() + piklist(get_terms('segments', array('hide_empty' => false)), array('term_id', 'name')))); piklist('field', array('type' => 'group', 'label' => 'Franchise Exchange Wise Registration No.', 'list' => false, 'fields' => array(array('type' => 'text', 'field' => 'nse_cash', 'label' => 'NSE Cash', 'columns' => 3), array('type' => 'text', 'field' => 'bse_cash', 'label' => 'BSE Cash', 'columns' => 3), array('type' => 'text', 'field' => 'nse_cds', 'label' => 'NSE CDS', 'columns' => 3), array('type' => 'text', 'field' => 'mcx', 'label' => 'MCX', 'columns' => 3), array('type' => 'text', 'field' => 'nse_fo', 'label' => 'NSE FO', 'columns' => 3), array('type' => 'text', 'field' => 'bse_fo', 'label' => 'BSE FO', 'columns' => 3), array('type' => 'text', 'field' => 'mcx_sx', 'label' => 'MCX SX', 'columns' => 3), array('type' => 'text', 'field' => 'ncd_ex', 'label' => 'NCDEX', 'columns' => 3)), 'on_post_status' => array('value' => 'lock'))); piklist('field', array('type' => 'group', 'label' => 'Other Memberships & Registrations', 'list' => false, 'fields' => array(array('type' => 'text', 'field' => 'nrn_insu', 'label' => 'NRN, Insurance Agency', 'columns' => 6), array('type' => 'text', 'field' => 'code_ncfm', 'label' => 'Code, NCFM, NISM', 'columns' => 6)), 'on_post_status' => array('value' => 'lock'))); piklist('field', array('type' => 'textarea', 'field' => 'franchise_office_permises_details', 'label' => 'Office Permises Details', 'description' => 'Add some general information about the office premises', 'attributes' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'))); piklist('field', array('type' => 'file', 'field' => 'franchise_office_permises_images', 'label' => __('Add Office Permises Image(s)', 'piklist-demo'), 'options' => array('modal_title' => __('Add File(s)', 'piklist-demo'), 'button' => __('Add', 'piklist-demo')), 'attributes' => array('class' => 'large-text'), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 5)))));
<?php /* Title: Details Description: Unit details. Post Type: unit Capability: manage_options Context: normal Priority: high Order: 2 Locked: true Collapse: false Meta box: false */ piklist('field', array('type' => 'text', 'scope' => 'post_meta', 'field' => 'available', 'label' => __('Available'), 'attributes' => array('class' => 'text'), 'position' => 'wrap')); piklist('field', array('type' => 'text', 'scope' => 'post_meta', 'field' => 'type', 'label' => __('Type'), 'attributes' => array('class' => 'text'), 'position' => 'wrap')); piklist('field', array('type' => 'text', 'scope' => 'post_meta', 'field' => 'size', 'label' => __('Size'), 'attributes' => array('class' => 'text'), 'position' => 'wrap')); piklist('field', array('type' => 'text', 'scope' => 'post_meta', 'field' => 'circulation', 'label' => __('Circulation'), 'attributes' => array('class' => 'text'), 'position' => 'wrap')); piklist('field', array('type' => 'radio', 'scope' => 'post_meta', 'field' => 'illumination', 'label' => __('Illumination'), 'value' => 'no', 'attributes' => array('class' => 'text'), 'position' => 'wrap', 'choices' => array('yes' => 'Yes', 'no' => 'No'))); piklist('field', array('type' => 'text', 'scope' => 'post_meta', 'field' => 'operator', 'label' => __('Operator'), 'attributes' => array('class' => 'text'), 'position' => 'wrap'));
<?php /* Title: Debug Setting: piklist_wp_helpers Tab: Develop Order: 99 Tab Order: 999 Flow: WP Helpers Settings Flow */ $setting = get_option('piklist_wp_helpers', false); piklist('field', array('type' => 'textarea', 'label' => __('WP Helpers database settings', 'wp-helpers'), 'value' => serialize($setting), 'attributes' => array('readonly' => 'readonly')));
<?php /* Title: Validation Fields Order: 10 Tab: Validation Flow: Demo Workflow */ piklist('field', array('type' => 'text', 'field' => 'validate_text_required', 'label' => __('Text Required', 'piklist-demo'), 'description' => "required => true", 'attributes' => array('class' => 'large-text', 'placeholder' => __('Enter text or this page won\'t save.', 'piklist-demo')), 'required' => true, 'validate' => array(array('type' => 'limit', 'options' => array('min' => 2, 'max' => 6, 'count' => 'characters'))))); piklist('field', array('type' => 'group', 'field' => 'validate_group_required', 'label' => __('Group Required', 'piklist-demo'), 'description' => __('Only the checkbox is required', 'piklist-demo'), 'add_more' => true, 'fields' => array(array('type' => 'text', 'field' => 'name', 'label' => 'Name', 'columns' => 8, 'attributes' => array('placeholder' => 'Name')), array('type' => 'checkbox', 'field' => 'hierarchical', 'label' => 'Type', 'required' => true, 'columns' => 4, 'choices' => array('true' => 'Hierarchical'))))); piklist('field', array('type' => 'text', 'label' => __('File Name', 'piklist-demo'), 'field' => 'sanitize_file_name', 'description' => __('Converts multiple words to a valid file name', 'piklist-demo'), 'sanitize' => array(array('type' => 'file_name')), 'attributes' => array('class' => 'large-text'))); piklist('field', array('type' => 'text', 'field' => 'validate_emaildomain', 'label' => __('Email address', 'piklist-demo'), 'description' => __('Validate Email and Email Domain', 'piklist-demo'), 'attributes' => array('class' => 'large-text'), 'validate' => array(array('type' => 'email'), array('type' => 'email_domain')))); piklist('field', array('type' => 'text', 'field' => 'validate_file_exists', 'label' => __('File exists?', 'piklist-demo'), 'description' => sprintf(__('Test with: %s', 'piklist-demo'), 'http://wordpress.org/plugins/about/readme.txt'), 'attributes' => array('class' => 'large-text'), 'validate' => array(array('type' => 'file_exists')))); piklist('field', array('type' => 'text', 'field' => 'validate_image', 'label' => __('Image'), 'description' => sprintf(__('Test with: %s', 'piklist-demo'), 'http://piklist.com/wp-content/themes/piklistcom-base/images/piklist-logo@2x.png'), 'attributes' => array('class' => 'large-text'), 'validate' => array(array('type' => 'image')))); piklist('field', array('type' => 'checkbox', 'field' => 'validate_checkbox_limit', 'label' => __('Checkbox', 'piklist-demo'), 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'value' => 'third', 'choices' => array('first' => __('First Choice', 'piklist-demo'), 'second' => __('Second Choice', 'piklist-demo'), 'third' => __('Third Choice', 'piklist-demo')), 'required' => true, 'validate' => array(array('type' => 'limit', 'options' => array('min' => 2, 'max' => 2))))); piklist('field', array('type' => 'file', 'field' => 'validate_upload_media_limit', 'label' => __('Add File(s)', 'piklist-demo'), 'description' => __('No more than one file is allowed', 'piklist-demo'), 'required' => true, 'options' => array('modal_title' => __('Add File(s)', 'piklist-demo'), 'button' => __('Add', 'piklist-demo')), 'attributes' => array('class' => 'large-text'), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 0, 'max' => 1))))); piklist('field', array('type' => 'group', 'field' => 'validate_group_add_more_limit', 'add_more' => true, 'label' => __('Grouped/Add-More with Limit', 'piklist-demo'), 'description' => __('No more than two add-mores are allowed', 'piklist-demo'), 'fields' => array(array('type' => 'text', 'field' => 'group_field_1', 'label' => __('Field 1', 'piklist-demo'), 'columns' => 12), array('type' => 'text', 'field' => 'group_field_2', 'label' => __('Field 2', 'piklist-demo'), 'columns' => 12)), 'validate' => array(array('type' => 'limit', 'options' => array('min' => 1, 'max' => 2))))); piklist('shared/code-locater', array('location' => __FILE__, 'type' => 'User Section'));