PHP code example of voceconnect / voce-post-meta-psu

1. Go to this page and download the library: Download voceconnect/voce-post-meta-psu 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-psu example snippets


if( ! class_exists( 'Voce_Post_Meta_Post_Selection_UI' ) ) {
	


add_action('init', function(){
	add_metadata_group( 'demo_meta', 'Page Options', array(
		'capability' => 'edit_posts'
	));
	add_metadata_field( 'demo_meta', 'post_selection_ui_key', 'Title', 'psu', array(
		'post_type' => 'custom_post_type',
		'post_status' => 'publish',
		'limit' => 3
	) );
	add_post_type_support( 'page', 'demo_meta' );
});