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

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



add_action('init', function(){
  add_metadata_group( 'demo_meta', 'Page Options', array(
      'capability' => 'edit_posts'
  ) );
  add_metadata_field( 'demo_meta', 'demo_color', 'Demo Color', 'color' );
  add_post_type_support( 'page', 'demo_meta' );
});


add_action('init', function(){
  add_metadata_group( 'demo_meta', 'Page Options', array(
      'capability' => 'edit_posts'
  ) );
  add_metadata_field( 'demo_meta', 'demo_color', 'Demo Color', 'color' );
  add_post_type_support( 'page', 'demo_meta' );
});