本文整理汇总了PHP中piklist函数的典型用法代码示例。如果您正苦于以下问题:PHP piklist函数的具体用法?PHP piklist怎么用?PHP piklist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了piklist函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fwe_register_post_type_location
/**
* 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;
}
示例2: restore_revision
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);
}
}
示例3: getLabels
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;
}
示例4: renderField
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);
}
示例5: _e
<?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'))));
示例6: piklist
<?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)));
示例7: array
** 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)));
示例8: piklist
<?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))));
示例9: cpt_franchise_taxo
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;
}
示例10: print_pointers
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']));
}
}
示例11: Box
<?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')));
示例12: jobapp_overall_work_experience_
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')));
示例13: piklist
<?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')));
示例14: piklist
<?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')));
示例15: piklist
<?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'));