Metabox Configure

Metabox Configure

Let’s open themename/wpsf-framework/config/metabox.config.php all examples there

also you can use override method for config. see override

.
├── themename
|   ├── wpsf-framework
|   |   ├── config
|   |   |   ├── metabox.config.php

take a look metabox.config.php example

if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
/**
 *
 * WPSFFramework Metabox Config
 *
 * @since 1.0
 * @version 1.0
 *
 */
$options        = array();

$options[]      = array(
  'id'            => '_custom_meta_options',
  'title'         => 'Custom Options',
  'post_type'     => 'page', // or post or CPT or array( 'page', 'post' )
  'context'       => 'normal',
  'priority'      => 'default',
  'sections'      => array(

    // begin section
    array(
      'name'      => 'section_1',
      'title'     => 'Section 1',
      'icon'      => 'fa fa-wifi',
      'fields'    => array(

        // a field
        array(
          'id'    => 'metabox_option_id',
          'type'  => 'text',
          'title' => 'An Text Option',
        ),

        // a field
        array(
          'id'    => 'metabox_option_other_id',
          'type'  => 'textarea',
          'title' => 'An Textarea Option',
        ),

      ),
    ),

    // begin section
    array(
      'name'      => 'section_2',
      'title'     => 'Section 2',
      'icon'      => 'fa fa-heart',
      'fields'    => array(

        // a field
        array(
          'id'    => 'metabox_option_2_id',
          'type'  => 'text',
          'title' => 'An Text Option',
        ),

      ),
    ),

  ),
);

WPSFFramework_Metabox::instance( $options );

You should use _custom_meta_options as this is the id for your key declared into metabox config file. So your code must look like this:

$meta_data = get_post_meta( THE_POST_ID, '_custom_meta_options', true );
var_dump( $meta_data );

Last updated