當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pods_v函數代碼示例

本文整理匯總了PHP中pods_v函數的典型用法代碼示例。如果您正苦於以下問題:PHP pods_v函數的具體用法?PHP pods_v怎麽用?PHP pods_v使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了pods_v函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: admin_page

 /**
  * Output admin page
  */
 public static function admin_page()
 {
     include_once 'Pods_Jobs_Queue_API.php';
     /**
      * @var $wpdb wpdb
      */
     global $wpdb;
     $table = Pods_Jobs_Queue_API::table();
     Pods_Jobs_Queue_API::install();
     $ui = array('item' => __('Job', 'pods-jobs-queue'), 'items' => __('Jobs', 'pods-jobs-queue'), 'header' => array('view' => __('View Job Info', 'pods-jobs-queue')), 'sql' => array('table' => $table, 'field_id' => 'id', 'field_index' => 'callback'), 'orderby' => '( `t`.`status` = "queued" ) DESC, ( `t`.`status` = "completed" ) DESC, `t`.`date_queued` DESC, `t`.`date_completed` DESC', 'fields' => array('manage' => array('callback' => array('name' => 'callback', 'label' => 'Callback', 'type' => 'text'), 'group' => array('name' => 'group', 'label' => 'Group', 'type' => 'text'), 'memo' => array('name' => 'memo', 'label' => 'Memo', 'type' => 'text'), 'status' => array('name' => 'status', 'label' => 'Status', 'type' => 'pick', 'pick_object' => 'custom-simple', 'data' => array('queued' => __('Queued', 'pods-jobs-queue'), 'processing' => __('Processing', 'pods-jobs-queue'), 'completed' => __('Completed', 'pods-jobs-queue'), 'failed' => __('Failed', 'pods-jobs-queue'))), 'date_queued' => array('name' => 'date_queued', 'label' => 'Time Queued', 'type' => 'datetime', 'options' => array('datetime_allow_empty' => 1)), 'date_started' => array('name' => 'date_started', 'label' => 'Time Started', 'type' => 'datetime', 'options' => array('datetime_allow_empty' => 1)), 'date_completed' => array('name' => 'date_completed', 'label' => 'Time Completed', 'type' => 'datetime', 'options' => array('datetime_allow_empty' => 1))), 'search' => array()), 'filters' => array('callback', 'memo', 'group', 'status', 'date_queued', 'date_started', 'date_completed'), 'filters_enhanced' => true, 'actions_disabled' => array('add', 'edit', 'duplicate', 'export'), 'actions_custom' => array('process_job' => array('callback' => array(__CLASS__, 'admin_page_process_job')), 'view' => array('callback' => array(__CLASS__, 'admin_page_view_job')), 'delete' => array('callback' => array(__CLASS__, 'admin_page_delete_job'))), 'actions_bulk' => array('delete' => array('label' => __('Delete', 'pods')), 'process_jobs' => array('callback' => array(__CLASS__, 'admin_page_process_jobs'))));
     $ui['fields']['search']['callback'] = $ui['fields']['manage']['callback'];
     $ui['fields']['search']['memo'] = $ui['fields']['manage']['memo'];
     $ui['fields']['search']['group'] = $ui['fields']['manage']['group'];
     $ui['fields']['search']['status'] = $ui['fields']['manage']['status'];
     $ui['fields']['search']['date_queued'] = $ui['fields']['manage']['date_queued'];
     $ui['fields']['search']['date_started'] = $ui['fields']['manage']['date_started'];
     $ui['fields']['search']['date_completed'] = $ui['fields']['manage']['date_completed'];
     $ui['fields']['view'] = $ui['fields']['manage'];
     unset($ui['fields']['view']['callback']);
     $ui['fields']['view']['arguments'] = array('name' => 'arguments', 'label' => 'Callback Arguments', 'type' => 'paragraph');
     $ui['fields']['view']['log'] = array('name' => 'log', 'label' => 'Callback Log', 'type' => 'text');
     $ui['fields']['view']['blog_id'] = array('name' => 'blog_id', 'label' => 'Blog ID', 'type' => 'number', 'options' => array('number_format_type' => '9999.99', 'number_decimals' => 0), 'width' => '5%');
     if (!defined('PODS_JOBS_QUEUE_GROUPS') || !PODS_JOBS_QUEUE_GROUPS) {
         unset($ui['fields']['manage']['group']);
         unset($ui['fields']['manage']['search']);
         unset($ui['fields']['manage']['view']);
         unset($ui['filters'][array_search('group', $ui['filters'])]);
     }
     if (1 == pods_v('deleted_bulk')) {
         unset($ui['actions_custom']['delete']);
     }
     pods_ui($ui);
 }
開發者ID:KevinFairbanks,項目名稱:pods-jobs-queue,代碼行數:36,代碼來源:Pods_Jobs_Queue_Admin.php

示例2: SLUG_new_salad_redirect

function SLUG_new_salad_redirect()
{
    //check if new_salad GET variable isset, act only if it is
    if (false !== ($new_salad_id = pods_v('new_salad', 'get', false, true))) {
        //use the value to get the link to the item and then redirect to it.
        //get peramlink only works for post types.
        ///Use get_term_link for taxonomies or build link manually for advanced content types
        pods_redirect(get_permalink($new_salad_id));
    }
}
開發者ID:logoscreative,項目名稱:pods-code-library,代碼行數:10,代碼來源:redirect-to-new-item.php

示例3: get_pod_id_shortcode

/**
 * Note: This is needed due to a bug issued here https://github.com/pods-framework/pods/issues/2284
 * The forum thread is: http://pods.io/forums/topic/some-lesson-learned/#post-185783
 *
 * Add Shortcode to generate a pods (template or form) that support a id passed vía GET (this is generic)
 * If we need to work with a related var (sub collection) you can indicate the "related pod" and a "where"
 * clause will be generated
 *    
 * @params
 *   id_get_var   is the id var passed via get that holds the id (i.e: give me a concrete author by its id
 *   related_pod  optional. If exists there's a related field to a one to many relation and is used in combination with id_get_var
 *                this is used to get a collection where subrelated field is equal to the id provided (i.e: all books from and author)
 * @usage
 *   [podsid name="author" form="1" id_get_var="author_id" fields="post_title, type_author" label="Save Author"/]
 *   [podsid name="books" id_get_var="author_id" related_pod="author" template="Books View" limit="10" pagination="1"/]
 */
function get_pod_id_shortcode($atts, $content = "")
{
    // get the pods form user attributes
    extract(shortcode_atts(array('id_get_var' => 'id', 'related_pod' => '', 'name' => '', 'fields' => '', 'form' => '0', 'template' => '', 'limit' => '', 'pagination' => '', 'label' => ''), $atts, 'podsid'));
    // get the id
    $id = pods_v($id_get_var, 'get', null, true);
    // where
    if ($related_pod == '') {
        $where = $id > 0 ? 't.ID = ' . $id : '';
    } else {
        $where = $id > 0 ? $related_pod . '.id = ' . $id : '';
    }
    $params = array('limit' => $limit, 'where' => $where);
    $_pod = pods($name, $params);
    if ($form == 1) {
        return $_pod->form($fields, $label);
    } else {
        return $_pod->template($template, $content);
    }
}
開發者ID:logoscreative,項目名稱:pods-code-library,代碼行數:36,代碼來源:pods-by-id-shortcode.php

示例4: data

 /**
  * Get the data from the field
  *
  * @param string $name The name of the field
  * @param string|array $value The value of the field
  * @param array $options
  * @param array $pod
  * @param int $id
  * @param boolean $in_form
  *
  * @return array Array of possible field data
  *
  * @since 2.0
  */
 public function data($name, $value = null, $options = null, $pod = null, $id = null, $in_form = true)
 {
     if ('checkbox' != pods_v(self::$type . '_format_type', $options)) {
         $data = array(1 => pods_var_raw(self::$type . '_yes_label', $options), 0 => pods_var_raw(self::$type . '_no_label', $options));
     } else {
         $data = array(1 => pods_var_raw(self::$type . '_yes_label', $options));
     }
     return $data;
 }
開發者ID:dylansmithing,項目名稱:leader-of-rock-wordpress,代碼行數:23,代碼來源:boolean.php

示例5: esc_attr_e

        var select_container = default_select.match( /<select[^<]*>/g );

        $el.find( '.pods-sister-field' ).html( select_container + '<option value=""><?php 
esc_attr_e('Loading available fields..', 'pods');
?>
</option></select>' );

        postdata = {
            action : 'pods_admin',
            method : 'load_sister_fields',
            _wpnonce : '<?php 
echo esc_js(wp_create_nonce('pods-load_sister_fields'));
?>
',
            pod : '<?php 
echo esc_js(pods_v('name', $pod));
?>
',
            related_pod : related_pod_name
        };

        jQuery.ajax( {
            type : 'POST',
            dataType : 'html',
            url : ajaxurl + '?pods_ajax=1',
            cache : false,
            data : postdata,
            success : function ( d ) {
                if ( -1 == d.indexOf( '<e>' ) && -1 == d.indexOf('</e>') && -1 != d && '[]' != d ) {
                    var json = d.match( /{.*}$/ );
開發者ID:jeremybradbury,項目名稱:wp-ninja-kit,代碼行數:30,代碼來源:setup-edit.php

示例6: get_table_info_load

 /**
  *
  * Load the information about an objects MySQL table
  *
  * @param $object_type
  * @param string $object The object to look for
  * @param null $name (optional) Name of the pod to load
  * @param array $pod (optional) Array with pod information
  *
  * @return array
  *
  * @since 2.5
  */
 public function get_table_info_load($object_type, $object, $name = null, $pod = null)
 {
     $info = array();
     if ('pod' == $object_type && null === $pod) {
         if (empty($name)) {
             $prefix = 'pod-';
             // Make sure we actually have the prefix before trying anything with the name
             if (0 === strpos($object_type, $prefix)) {
                 $name = substr($object_type, strlen($prefix), strlen($object_type));
             }
         }
         if (empty($name) && !empty($object)) {
             $name = $object;
         }
         $pod = $this->load_pod(array('name' => $name, 'table_info' => false), false);
         if (!empty($pod)) {
             $object_type = $pod['type'];
             $name = $pod['name'];
             $object = $pod['object'];
             $info['pod'] = $pod;
         }
     } elseif (null === $pod) {
         if (empty($name)) {
             $prefix = $object_type . '-';
             // Make sure we actually have the prefix before trying anything with the name
             if (0 === strpos($object_type, $prefix)) {
                 $name = substr($object_type, strlen($prefix), strlen($object_type));
             }
         }
         if (empty($name) && !empty($object)) {
             $name = $object;
         }
         if (!empty($name)) {
             $pod = $this->load_pod(array('name' => $name, 'table_info' => false), false);
             if (!empty($pod) && (null === $object_type || $object_type == $pod['type'])) {
                 $object_type = $pod['type'];
                 $name = $pod['name'];
                 $object = $pod['object'];
                 $info['pod'] = $pod;
             }
         }
     } elseif (!empty($pod)) {
         $info['pod'] = $pod;
     }
     if (0 === strpos($object_type, 'pod')) {
         if (empty($name)) {
             $prefix = 'pod-';
             // Make sure we actually have the prefix before trying anything with the name
             if (0 === strpos($object_type, $prefix)) {
                 $name = substr($object_type, strlen($prefix), strlen($object_type));
             }
         }
         $info['type'] = 'pod';
         global $wpdb;
         $info['table'] = $info['meta_table'] = $wpdb->prefix . 'pods_' . (empty($object) ? $name : $object);
         if (is_array($info['pod']) && 'pod' == pods_v('type', $info['pod'])) {
             $info['pod_field_index'] = $info['field_index'] = $info['meta_field_index'] = $info['meta_field_value'] = pods_v('pod_index', $info['pod']['options'], 'id', true);
             $slug_field = get_posts(array('post_type' => '_pods_field', 'posts_per_page' => 1, 'nopaging' => true, 'post_parent' => $info['pod']['id'], 'orderby' => 'menu_order', 'order' => 'ASC', 'meta_query' => array(array('key' => 'type', 'value' => 'slug'))));
             if (!empty($slug_field)) {
                 $slug_field = $slug_field[0];
                 $info['field_slug'] = $info['pod_field_slug'] = $slug_field->post_name;
             }
             if (1 == pods_v('hierarchical', $info['pod']['options'], 0)) {
                 $parent_field = pods_v('pod_parent', $info['pod']['options'], 'id', true);
                 if (!empty($parent_field) && isset($info['pod']['fields'][$parent_field])) {
                     $info['object_hierarchical'] = true;
                     $info['pod_field_parent'] = $info['field_parent'] = $parent_field . '_select';
                     $info['field_parent_select'] = '`' . $parent_field . '`.`id` AS `' . $info['field_parent'] . '`';
                 }
             }
         }
     }
     return $info;
 }
開發者ID:satokora,項目名稱:IT354Project,代碼行數:87,代碼來源:PodsAPI.php

示例7: __

//meta title
$pods->meta['title'] = __('Your Meta Title Here', 'text-domain');
//meta descrioption
$pods->meta['description'] = __('Your Meta Description Here', 'text-domain');
/**
 * SEO Fields for Pods advanced content types. Using dynamically generated content.
 *
 * Goes in Pods Page precode field.
 *
 * Be sure to note inline comments about fields that are presumed to exist that DO NOT exist by default.
 */
/**Setup Pods Object**/
//get current url
$slug = pods_v('last', 'url');
//get pod name
$pod_name = pods_v(0, 'url');
//get pods object for current item
$pods = pods($pod_name, $slug);
/*title field*/
//assumes field name of meta_title exists
$pods->meta['title'] = __($pods->field('meta_title'), 'translation-domain') . '&nbsp;|&nbsp;';
/*meta description*/
//presumes field name of 'meta_desc' exists
$pods->meta['description'] = __($pods->field('meta_desc'), 'translation-domain');
$pods->meta_properties['og:description'] = __($pods->field('meta_desc', 'translation-domain'));
/**Google+ Profile Link**/
//Presumes users is extended with a field called 'google_plus'
//Also presumes ACT has a field called page_author, related to Users
$author = $pods->field('page_author');
echo '<link rel="author" href="' . esc_url(get_the_author_meta('google_plus', $author['ID'])) . ' "/>';
/*OpenGrpah Image*/
開發者ID:logoscreative,項目名稱:pods-code-library,代碼行數:31,代碼來源:act-seo.php

示例8: esc_js

						return {
							// Simply use the new tag term as the id
							//we might want to append 'new' to all newly created term IDs for processing in PodsAPI.php
							id: term.trim(),
							text: term.trim()
						};
					}
				},
			<?php 
}
?>

            width : 'resolve',

			<?php 
if (1 == (int) pods_v($form_field_type . '_allow_html', $options)) {
    ?>
				escapeMarkup : function (m) { return m; },
			<?php 
}
?>

            initSelection : function ( element, callback ) {
                var data = [];

                jQuery( element.val().split( "," ) ).each( function () {
                    if ( 'undefined' != typeof <?php 
echo esc_js(pods_js_name($attributes['id']));
?>
_data[ this ] ) {
                        data.push( {
開發者ID:dylansmithing,項目名稱:leader-of-rock-wordpress,代碼行數:31,代碼來源:select2.php

示例9: view

    /**
     * @return bool|mixed
     * @since 2.3.10
     */
    public function view()
    {
        if (false !== $this->callback_action('view')) {
            return null;
        }
        if (empty($this->row)) {
            $this->get_row();
        }
        if (empty($this->row)) {
            return $this->error(sprintf(__('<strong>Error:</strong> %s not found.', 'pods'), $this->item));
        }
        $pod =& $this->pod;
        $fields = array();
        if (isset($this->fields[$this->action])) {
            $fields = $this->fields[$this->action];
        }
        if (is_object($this->pod)) {
            $object_fields = (array) pods_var_raw('object_fields', $this->pod->pod_data, array(), null, true);
            $object_field_objects = array('post_type', 'taxonomy', 'media', 'user', 'comment');
            if (empty($object_fields) && in_array($this->pod->pod_data['type'], $object_field_objects)) {
                $object_fields = $this->pod->api->get_wp_object_fields($this->pod->pod_data['type'], $this->pod->pod_data);
            }
            if (empty($fields)) {
                // Add core object fields if $fields is empty
                $fields = array_merge($object_fields, $this->pod->fields);
            }
        }
        $view_fields = $fields;
        // Temporary
        $fields = array();
        foreach ($view_fields as $k => $field) {
            $name = $k;
            $defaults = array('name' => $name, 'type' => 'text', 'options' => 'text');
            if (!is_array($field)) {
                $name = $field;
                $field = array('name' => $name);
            }
            $field = array_merge($defaults, $field);
            $field['name'] = trim($field['name']);
            $value = pods_var_raw('default', $field);
            if (empty($field['name'])) {
                $field['name'] = trim($name);
            }
            if (isset($object_fields[$field['name']])) {
                $field = array_merge($field, $object_fields[$field['name']]);
            } elseif (isset($this->pod->fields[$field['name']])) {
                $field = array_merge($this->pod->fields[$field['name']], $field);
            }
            if (pods_v('hidden', $field, false, null, true) || 'hidden' == $field['type']) {
                continue;
            } elseif (!PodsForm::permission($field['type'], $field['name'], $field['options'], $fields, $pod, $pod->id())) {
                continue;
            }
            $fields[$field['name']] = $field;
            if (empty($this->id) && null !== $value) {
                $this->pod->row_override[$field['name']] = $value;
            }
        }
        unset($view_fields);
        // Cleanup
        ?>
		<div class="wrap pods-ui">
			<div id="icon-edit-pages" class="icon32"<?php 
        if (false !== $this->icon) {
            ?>
 style="background-position:0 0;background-size:100%;background-image:url(<?php 
            echo $this->icon;
            ?>
);"<?php 
        }
        ?>
><br /></div>
			<h2>
				<?php 
        echo $this->do_template($this->header['view']);
        if (!in_array('add', $this->actions_disabled) && !in_array('add', $this->actions_hidden)) {
            $link = pods_query_arg(array('action' . $this->num => 'add', 'id' . $this->num => '', 'do' . ($this->num = '')), self::$allowed, $this->exclusion());
            if (!empty($this->action_links['add'])) {
                $link = $this->action_links['add'];
            }
            ?>
					<a href="<?php 
            echo $link;
            ?>
" class="add-new-h2"><?php 
            echo $this->heading['add'];
            ?>
</a>
				<?php 
        } elseif (!in_array('manage', $this->actions_disabled) && !in_array('manage', $this->actions_hidden)) {
            $link = pods_query_arg(array('action' . $this->num => 'manage', 'id' . $this->num => ''), self::$allowed, $this->exclusion());
            if (!empty($this->action_links['manage'])) {
                $link = $this->action_links['manage'];
            }
            ?>
					<a href="<?php 
//.........這裏部分代碼省略.........
開發者ID:Ingenex,項目名稱:redesign,代碼行數:101,代碼來源:PodsUI.php

示例10: traverse_recurse


//.........這裏部分代碼省略.........
         $traverse['table_info'] = $this->api->get_table_info('post_type', 'attachment');
     } elseif (!in_array($traverse['type'], $tableless_field_types)) {
         $traverse['table_info'] = $this->api->get_table_info($pod_data['type'], $pod_data['name'], $pod_data['name'], $pod_data);
     } elseif (empty($traverse['table_info']) || in_array($traverse['pick_object'], $simple_tableless_objects) && !empty($traverse_recurse['last_table_info'])) {
         if (in_array($traverse['pick_object'], $simple_tableless_objects) && !empty($traverse_recurse['last_table_info'])) {
             $traverse['table_info'] = $traverse_recurse['last_table_info'];
             if (!empty($traverse['table_info']['meta_table'])) {
                 $meta_data_table = true;
             }
         } elseif (!in_array($traverse['type'], $tableless_field_types) && !empty($traverse_recurse['last_table_info']) && 0 == $traverse_recurse['depth']) {
             $traverse['table_info'] = $traverse_recurse['last_table_info'];
         } else {
             if (!isset($traverse['pod'])) {
                 $traverse['pod'] = null;
             }
             $traverse['table_info'] = $this->api->get_table_info($traverse['pick_object'], $traverse['pick_val'], null, $traverse['pod'], $traverse);
         }
     }
     if (isset($this->traversal[$traverse_recurse['pod']][$traverse['name']])) {
         $traverse = array_merge($traverse, (array) $this->traversal[$traverse_recurse['pod']][$traverse['name']]);
     }
     $traverse = apply_filters('pods_data_traverse', $traverse, compact('pod', 'fields', 'joined', 'depth', 'joined_id', 'params'), $this);
     if (empty($traverse)) {
         return $joins;
     }
     $traverse['id'] = (int) $traverse['id'];
     if (empty($traverse['id'])) {
         $traverse['id'] = $field;
     }
     $table_info = $traverse['table_info'];
     $this->traversal[$traverse_recurse['pod']][$field] = $traverse;
     $field_joined = $field;
     if (0 < $traverse_recurse['depth'] && 't' != $traverse_recurse['joined']) {
         if ($meta_data_table && ('pick' != $traverse['type'] || !in_array(pods_var('pick_object', $traverse), $simple_tableless_objects))) {
             $field_joined = $traverse_recurse['joined'] . '_d';
         } else {
             $field_joined = $traverse_recurse['joined'] . '_' . $field;
         }
     }
     $rel_alias = 'rel_' . $field_joined;
     if (pods_v('search', $traverse_recurse['params'], false) && empty($traverse_recurse['params']->filters)) {
         if (0 < strlen(pods_var('filter_' . $field_joined, 'get'))) {
             $val = absint(pods_var('filter_' . $field_joined, 'get'));
             $search = "`{$field_joined}`.`{$table_info['field_id']}` = {$val}";
             if ('text' == $this->search_mode) {
                 $val = pods_var('filter_' . $field_joined, 'get');
                 $search = "`{$field_joined}`.`{$traverse['name']}` = '{$val}'";
             } elseif ('text_like' == $this->search_mode) {
                 $val = pods_sanitize(pods_sanitize_like(pods_var_raw('filter_' . $field_joined)));
                 $search = "`{$field_joined}`.`{$traverse['name']}` LIKE '%{$val}%'";
             }
             $this->search_where[] = " {$search} ";
         }
     }
     $the_join = null;
     $joined_id = $table_info['field_id'];
     $joined_index = $table_info['field_index'];
     if ('taxonomy' == $traverse['type']) {
         $rel_tt_alias = 'rel_tt_' . $field_joined;
         if ($meta_data_table) {
             $the_join = "\n                    LEFT JOIN `{$table_info['pod_table']}` AS `{$field_joined}` ON\n                        `{$field_joined}`.`{$table_info['pod_field_id']}` = `{$traverse_recurse['rel_alias']}`.`{$traverse_recurse['joined_id']}`\n                ";
         } else {
             $the_join = "\n                    LEFT JOIN `{$wpdb->term_relationships}` AS `{$rel_alias}` ON\n                        `{$rel_alias}`.`object_id` = `{$traverse_recurse['joined']}`.`ID`\n\n                    LEFT JOIN `{$wpdb->term_taxonomy}` AS `{$rel_tt_alias}` ON\n                        `{$rel_tt_alias}`.`taxonomy` = '{$traverse['name']}'\n                        AND `{$rel_tt_alias}`.`term_taxonomy_id` = `{$rel_alias}`.`term_taxonomy_id`\n\n                    LEFT JOIN `{$table_info['table']}` AS `{$field_joined}` ON\n                        `{$field_joined}`.`{$table_info['field_id']}` = `{$rel_tt_alias}`.`{$table_info['field_id']}`\n                ";
             // Override $rel_alias
             $rel_alias = $field_joined;
             $joined_id = $table_info['field_id'];
開發者ID:ngdinhbinh,項目名稱:fine-interior,代碼行數:67,代碼來源:PodsData.php

示例11: archive_warning

 /**
  * Throw admin warnings for post types that have archive templates set, but don't support archives
  *
  * @since 2.4.5
  */
 function archive_warning()
 {
     //create $page variable to check if we are on pods admin page
     $page = pods_v('page', 'get', false, true);
     //check if we are on Pods Admin page
     if ($page === 'pods') {
         $archive_test = $this->archive_test();
         if (is_array($archive_test)) {
             foreach ($archive_test as $label => $test) {
                 if ($test === 'fail') {
                     echo sprintf('<div id="message" class="error"><p>%s</p></div>', sprintf(__('The Pods post type %1$s has an archive template set to be displayed using Pods auto template, but the Pod does not have an archive. You can enable post type archives in the "Advanced Options" tab.', 'pfat'), $label));
                 }
             }
         }
     }
 }
開發者ID:benbrandt,項目名稱:pods,代碼行數:21,代碼來源:Pods_Templates_Auto_Template_Settings.php

示例12: pods_video

/**
 * Output a video field as a video player.
 *
 * @uses wp_video_shortcode()
 *
 * @since 2.5
 *
 * @param string|array   $url   Can be a URL of the source file, or a Pods video field.
 * @param bool|array     $args  Optional. Additional arguments to pass to wp_video_shortcode()
 *
 * @return string
 */
function pods_video($url, $args = false)
{
    if (is_array($url)) {
        if (!is_null(pods_v('ID', $url))) {
            $id = pods_v('ID', $url);
            $url = wp_get_attachment_url($id);
        } else {
            return;
        }
    }
    $video_args = array('src' => $url);
    if (is_array($args)) {
        $video_args = array_merge($video_args, $args);
    }
    return wp_video_shortcode($video_args);
}
開發者ID:dylansmithing,項目名稱:leader-of-rock-wordpress,代碼行數:28,代碼來源:media.php

示例13: pods_s_get_header

 * @package pods_s
 */
pods_s_get_header();
?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

		<?php 
if (have_posts()) {
    //Build pods object for current item or return false if no Pod for this content type
    $pods = pods(null, get_the_ID(), true);
    //get name of pod
    if ($pods) {
        $pod_name = pods_s_get_content_type(true);
        $pod_name = pods_v('specific_type', $pod_name, false, true);
    }
    while (have_posts()) {
        the_post();
        //test if we have a valid Pods object.
        if ($pods and $pod_name) {
            //Output template of the same name as Pod, if such a template exists.
            //if it doesn't output template part
            $temp = $pods->template($pod_name);
            if (isset($temp)) {
                echo $temp;
            } else {
                pods_s_get_template_part('content', pods_s_part_by_post_type(), compact(array('pods')));
            }
        } else {
            pods_s_get_template_part('content', pods_s_part_by_post_type());
開發者ID:logoscreative,項目名稱:pods-code-library,代碼行數:31,代碼來源:single.php

示例14: prepare_data

 /**
  * Prepare data to be saved
  *
  * @param array $data
  */
 protected function prepare_data($data)
 {
     $details = pods_v_sanitized('details', $data, [], true);
     $this->data = ['datetime' => current_time('mysql'), 'license' => $this->get_license_id($data['license']), 'url' => pods_v_sanitized('url', $data, null), 'wp_ver' => pods_v_sanitized('wp_version', $details, 0), 'ingot_ver' => pods_v_sanitized('ingot_version', $details, 0), 'php_ver' => pods_v_sanitized('php_version', $details, 0), 'vertical' => pods_v_sanitized('ing_vertical', $details, 0), 'trial' => boolval(pods_v('trial', $data, false, true))];
 }
開發者ID:Ingothq,項目名稱:ingSL,代碼行數:10,代碼來源:checkin.php

示例15: pods_var

        }
        $more = true;
        $extra = '';
        $max_length = (int) pods_var('maxlength', $field['options'], pods_var($field['type'] . '_max_length', $field['options'], 0), null, true);
        if (0 < $max_length) {
            $extra .= ' maxlength="' . esc_attr($max_length) . '"';
        }
        /**
         * Filter that lets you make the title field readonly
         *
         * @param Pods $pod Current Pods object.
         * @param PodsUI $obj Current PodsUI object.
         *
         * @since 2.5
         */
        if (pods_v('readonly', $field['options'], pods_v('readonly', $field, false)) || apply_filters('pods_ui_form_title_readonly', false, $pod, $obj)) {
            ?>
                                    <div id="titlediv">
                                        <div id="titlewrap">
                                            <h3><?php 
            echo esc_html($pod->index());
            ?>
</h3>
                                            <input type="hidden" name="pods_field_<?php 
            echo esc_attr($pod->pod_data['field_index']);
            ?>
" data-name-clean="pods-field-<?php 
            echo esc_attr($pod->pod_data['field_index']);
            ?>
" id="title" size="30" tabindex="1" value="<?php 
            echo esc_attr(htmlspecialchars($pod->index()));
開發者ID:dylansmithing,項目名稱:leader-of-rock-wordpress,代碼行數:31,代碼來源:form.php


注:本文中的pods_v函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。