PHP code example of ivanyankov / meta-fields-builder
1. Go to this page and download the library: Download ivanyankov/meta-fields-builder 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/ */
ivanyankov / meta-fields-builder example snippets
use Yankov\MetaFieldsBuilder\MetaBox\MetaBoxBuilder;
use Yankov\MetaFieldsBuilder\Fields\TextField;
$fields = [
new TextField('text_field_name', 'Text Field')
];
$metaBox = MetaBoxBuilder::make('custom_meta_box_id', 'Advanced Custom Meta Box', $fields, 'post');
$field_value = get_post_meta($post_id, "text_field_name", true);