当前位置: 首页>>代码示例>>PHP>>正文


PHP acf_is_local_field函数代码示例

本文整理汇总了PHP中acf_is_local_field函数的典型用法代码示例。如果您正苦于以下问题:PHP acf_is_local_field函数的具体用法?PHP acf_is_local_field怎么用?PHP acf_is_local_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了acf_is_local_field函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _acf_get_field_by_key

function _acf_get_field_by_key($key = '', $db_only = false)
{
    // try JSON before DB to save query time
    if (!$db_only && acf_is_local_field($key)) {
        return acf_get_local_field($key);
    }
    // vars
    $post_id = acf_get_field_id($key);
    // bail early if no post_id
    if (!$post_id) {
        return false;
    }
    // return
    return _acf_get_field_by_id($post_id, $db_only);
}
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:15,代码来源:api-field.php

示例2: acf_get_local_field

function acf_get_local_field($key)
{
    // bail early if no field
    if (!acf_is_local_field($key)) {
        return false;
    }
    // return
    return acf_local()->fields[$key];
}
开发者ID:slavic18,项目名称:cats,代码行数:9,代码来源:local.php

示例3: _acf_get_field_by_key

function _acf_get_field_by_key($key = '', $db_only = false)
{
    // try JSON before DB to save query time
    if (!$db_only && acf_is_local_field($key)) {
        $field = acf_get_local_field($key);
        // validate
        $field = acf_get_valid_field($field);
        // return
        return $field;
    }
    // vars
    $post_id = acf_get_field_id($key);
    // validate
    if (!$post_id) {
        return false;
    }
    // return
    return _acf_get_field_by_id($post_id, $db_only);
}
开发者ID:jorgesoulness,项目名称:mexifilter,代码行数:19,代码来源:api-field.php

示例4: _acf_get_field_by_key

function _acf_get_field_by_key($key = '')
{
    // vars
    $field = false;
    // try JSON before DB to save query time
    if (acf_is_local_field($key)) {
        $field = acf_get_local_field($key);
        // validate
        $field = acf_get_valid_field($field);
        // return
        return $field;
    }
    // vars
    $args = array('posts_per_page' => 1, 'post_type' => 'acf-field', 'orderby' => 'menu_order title', 'order' => 'ASC', 'suppress_filters' => false, 'acf_field_key' => $key);
    // load posts
    $posts = get_posts($args);
    // validate
    if (empty($posts)) {
        return $field;
    }
    // load from ID
    $field = _acf_get_field_by_id($posts[0]->ID);
    // return
    return $field;
}
开发者ID:spiff888,项目名称:rockharbor,代码行数:25,代码来源:api-field.php

示例5: add_field

 function add_field($field)
 {
     // validate
     $field = acf_get_valid_field($field);
     // don't allow overrides
     // edit: some manually created fields (via .php) used duplicate keys (copy of origional field).
     /*
     if( acf_is_local_field($field['key']) ) {
     			
     			return;	
     			
     		}
     */
     // vars
     $parent = $field['parent'];
     // append $parents
     $this->parents[$parent][] = $field['key'];
     // add in menu order
     $field['menu_order'] = count($this->parents[$parent]) - 1;
     // find ancestors
     //$field['ancestors'] = array();
     while (acf_is_local_field($parent)) {
         //$field['ancestors'][] = $parent;
         $parent = acf_get_local_field($parent);
         $parent = $parent['parent'];
     }
     //$field['ancestors'][] = $field['field_group'];
     // add field
     $this->fields[$field['key']] = $field;
 }
开发者ID:mariussunde,项目名称:Sn-hetta-Designmanual-WP-Theme,代码行数:30,代码来源:local.php


注:本文中的acf_is_local_field函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。