Linux 软件免费装
Banner图

ACF to WP REST API

开发者 airesvsg
更新时间 2016年1月24日 06:00
PHP版本: 3.0.1 及以上
WordPress版本: 4.4
版权: MIT
版权网址: 版权信息

标签

wordpress json acf api rest wp-api wp-rest-api wp

下载

详情介绍:

This version was discontinued, please upgrade to V2 https://wordpress.org/plugins/acf-to-rest-api/ Puts in answers all fields of ACF. Fork me on GitHub https://github.com/airesvsg/acf-to-wp-rest-api Get ACF data by ID Get Options Get Option by Field Name Sample Answer { "ID" : 1, "post_title" : "Post 1", "..." "acf" : { "field1" : "value 1", "field2" : "value 2" } } Filter Use the filter (acf_to_wp_rest_api_{type}_data) to customize the answer. The wildcard {type} can be: post, page, user, term, comment, attachment or options How to use add_filter( 'acf_to_wp_rest_api_post_data', function( $data, $object, $context ) { if ( isset( $data['type'] ) && 'my_post_type' == $data['type'] && isset( $data['acf'] ) ) { // do something } return $data; }, 10, 3 );

安装:

  1. Copy the acf-to-wp-rest-api folder into your wp-content/plugins folder
  2. Activate the ACF to WP REST API plugin via the plugins admin page