Download the PHP package airesvsg/acf-to-rest-api without Composer

On this page you can find all versions of the php package airesvsg/acf-to-rest-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package acf-to-rest-api

ACF to REST API

Exposes Advanced Custom Fields Endpoints in the WordPress REST API

https://wordpress.org/plugins/acf-to-rest-api/

Installation

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

Endpoints

Endpoint READABLE EDITABLE
/wp-json/acf/v3/posts πŸ†• βœ… ❌
/wp-json/acf/v3/posts/{id} βœ… βœ…
/wp-json/acf/v3/posts/{id}/{field-name} βœ… βœ…
/wp-json/acf/v3/pages πŸ†• βœ… ❌
/wp-json/acf/v3/pages/{id} βœ… βœ…
/wp-json/acf/v3/pages/{id}/{field-name} βœ… βœ…
/wp-json/acf/v3/users πŸ†• βœ… ❌
/wp-json/acf/v3/users/{id} βœ… βœ…
/wp-json/acf/v3/users/{id}/{field-name} βœ… βœ…
/wp-json/acf/v3/{taxonomy} πŸ†• βœ… ❌
/wp-json/acf/v3/{taxonomy}/{id} πŸ†• βœ… βœ…
/wp-json/acf/v3/{taxonomy}/{id}/{field-name} πŸ†• βœ… βœ…
/wp-json/acf/v3/comments πŸ†• βœ… ❌
/wp-json/acf/v3/comments/{id} βœ… βœ…
/wp-json/acf/v3/comments/{id}/{field-name} βœ… βœ…
/wp-json/acf/v3/media πŸ†• βœ… ❌
/wp-json/acf/v3/media/{id} βœ… βœ…
/wp-json/acf/v3/media/{id}/{field-name} βœ… βœ…
/wp-json/acf/v3/{post-type} πŸ†• βœ… ❌
/wp-json/acf/v3/{post-type}/{id} πŸ†• βœ… βœ…
/wp-json/acf/v3/{post-type}/{id}/{field-name} πŸ†• βœ… βœ…
/wp-json/acf/v3/options/{id} πŸ†• βœ… βœ…
/wp-json/acf/v3/options/{id}/{field-name} πŸ†• βœ… βœ…

Filters

Filter Argument(s)
acf/rest_api/id mixed ( string, integer, boolean ) $id
string $type πŸ†•
string $controller πŸ†•
acf/rest_api/key string $key
WP_REST_Request $request
string $type
acf/rest_api/item_permissions/get boolean $permission
WP_REST_Request $request
string $type
acf/rest_api/item_permissions/update boolean $permission
WP_REST_Request $request
string $type
acf/rest_api/{type}/prepare_item mixed ( array, boolean ) $item
WP_REST_Request $request
acf/rest_api/{type}/get_fields mixed ( array, WP_REST_Request ) $data
mixed ( WP_REST_Request, NULL ) $request
acf/rest_api/field_settings/show_in_rest πŸ†• boolean $show
acf/rest_api/field_settings/edit_in_rest πŸ†• boolean $edit

Basic example of how to use the filters, in this case I will set a new permission to get the fields

Deprecated filters

Filter Argument(s)
acf/rest_api/type string $type
acf/rest_api/types array $types
acf/rest_api/default_rest_base boolean $default
string $type

Request API version

See below how to select the Request API Version.

  1. Open the plugins page;
  2. Click the settings link under the pluing name ( ACF to REST API );
  3. Select your version in the ACF to REST API session;
  4. Click in the button Save changes.

The other alternative is to define the constant ACF_TO_REST_API_REQUEST_VERSION in your wp-config.php

Field Settings

In this version is possible to configure the field options via admin.

The options are enabled using the filters below, by default theses options are disabled.

Editing the fields

The fields should be sent into the key fields.

Action: http://localhost/wp-json/acf/v3/posts/1

Action: http://localhost/wp-json/wp/v2/posts/1

Use the filter acf/rest_api/key to change the key fields.

Now, the fields should be sent into the key acf_fields

Examples

Sample theme to edit the ACF Fields.

https://github.com/airesvsg/acf-to-rest-api-example

To-do list πŸ†•

https://github.com/airesvsg/to-do-list-acf-to-rest-api

Get ACF Fields RecursivelyπŸ†•

https://github.com/airesvsg/acf-to-rest-api-recursive

More details:

Cache

Enable caching for WordPress REST API and increase speed of your application.

https://github.com/airesvsg/wp-rest-api-cache


All versions of acf-to-rest-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package airesvsg/acf-to-rest-api contains the following files

Loading the files please wait ....