PHP code example of wordpress-gcb / fields
1. Go to this page and download the library: Download wordpress-gcb/fields 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/ */
wordpress-gcb / fields example snippets
use GCBFields\Schema;
$controls = json_decode(
file_get_contents( __DIR__ . '/blocks/hero/block.fields.json' ),
true
)['controls'];
register_block_type( __DIR__ . '/blocks/hero', [
'attributes' => Schema::attributes( $controls ),
] );