Download the PHP package davidwebca/acf-block-save-to-meta without Composer

On this page you can find all versions of the php package davidwebca/acf-block-save-to-meta. 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-block-save-to-meta

ACF Block Save To Meta [WIP]

Allows adding a setting to ACF fields to save the field's data to wp_postmeta. This is a work in progress, use at your own risk.

WARNING

The official ACF team has mentionned that they would add this in core relatively soon. You can follow the related issue here.

Requirements

Installation

Install via Composer:

If your theme already uses composer, the filters will be automatically added thanks to the auto-loading and auto-instantiating class. Otherwise, if you're looking for a standalone solution, copy src/ACF_SaveToMeta.php to your theme's folder and include it in functions.php.

Instructions

Every field you need to have saved to post meta needs to have its option checked to "yes" in the field's settings. Fields that don't have this option checked will be ignored and saved normally to the block's meta block in the post content.

Known issues

Currently, this code doesn't check if multiple of the same block or if multiple fields have the same name. If multiple blocks have the option "Save to meta" enabled, or if multiple of these blocks have identical field names, the latest one added to the editor will be the prevalent data, thus the one that will be saved to meta.

A future solution might be added to never allow saving to meta when "multiple" isn't true, but it is currently impractical or impossible to implement.

Also, you'll have to use the regular "get_post_meta()" outside of the post's single (in loops etc.) to get the data because ACF currently looks up field values with "get_field" which passes through some location validation. Since our field is not associated to the post, but to a block on the post, it doesn't always return the right value, especially if you're migrating from a real post (meta) location to a block.

Bug Reports and contributions

All issues can be reported right here on github and I'll take a look at it. Make sure to give as many details as possible since I'm working full-time and will only look at them once in a while. Feel free to add the code yourself with a pull request.

License

This code is provided under the MIT License.


All versions of acf-block-save-to-meta with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
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 davidwebca/acf-block-save-to-meta contains the following files

Loading the files please wait ....