PHP code example of timothyjensen / acf-field-group-values
1. Go to this page and download the library: Download timothyjensen/acf-field-group-values library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
timothyjensen / acf-field-group-values example snippets
// Replace with the name of your field group JSON.
$field_group_json = 'group_59e226a200966.json';
$config = json_decode( file_get_contents( PATH_TO_ACF_JSON . $field_group_json ), true );
// The $block variable is passed to the render callback or template.
$data = $block['data'];
$acf_block_data = get_structured_block_data( $data, $config );
// Replace with the names of your field group JSONs.
$clone_json_1 = 'group_59e226a200967.json';
$clone_json_2 = 'group_59e226a200968.json';
$clone_fields = [
json_decode( file_get_contents( PATH_TO_ACF_JSON . $clone_json_1 ), true ),
json_decode( file_get_contents( PATH_TO_ACF_JSON . $clone_json_2 ), true )
];
$acf_post_meta = get_all_custom_field_meta( get_the_ID(), $config, $clone_fields );