PHP code example of voceconnect / voce-post-meta-widgets
1. Go to this page and download the library: Download voceconnect/voce-post-meta-widgets 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/ */
voceconnect / voce-post-meta-widgets example snippets
add_action('init', function() {
if ( class_exists('Voce_Meta_API') ) {
add_metadata_group( 'demo_meta', 'Page Options', array(
'capability' => 'edit_posts'
));
add_metadata_field( 'demo_meta', 'demo_widgets', 'Demo Widget Area', 'widgets' );
add_post_type_support( 'post', 'demo_meta' );
}
});