hanamura / acf-util
高级自定义字段实用工具
1.0.1
2014-11-11 08:21 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-24 03:17:57 UTC
README
高级自定义字段实用工具。
示例
AcfUtil\AcfValue
提供对高级自定义字段字段对象的简单访问。
// initialize AcfValue with field objects for specific post // note: `get_field_objects()` is a buildin function of Advanced Custom Fields $acf_value = new AcfUtil\AcfValue(get_field_objects($id)); // access field $value = $acf_value->field_name; // access repeater field $value = $acf_value->repeater_field_name; foreach (var $acf_value->repeater_field_name as $repeater_field) { // child field is also AcfValue object $value = $repeater_field->field_name; // deeper repeater fields are accessible foreach (var $repeater_field->deeper_repeater_field_name as $deeper_repeater_field) { // this is also AcfValue object $value = $deeper_repeater_field->field_name; } }
需求
WordPress 和高级自定义字段插件。
许可
MIT