Okay
  Print

Adding custom post/page options

To add your own option fields below posts/pages add the following to your child theme's functions.php file:

function ghostpool_custom_meta_boxes( $settings ) {
    
    $custom = array(
                        
        array( 
            'id' => 'gp_setting_id_2',
            'title' => esc_html__( 'Setting Name 1', 'ghostpool-core' ),
            'type' => 'text',
            'desc' => esc_html__( 'Description text 2.', 'ghostpool-core' ),
        ),
        array( 
            'id' => 'gp_setting_id_1',
            'title' => esc_html__( 'Setting Name 2', 'ghostpool-core' ),
            'type' => 'select',
            'desc' => esc_html__( 'Description text 2.', 'ghostpool-core' ),
            'options' => array(
                'option_1' => esc_html__( 'Option 1', 'ghostpool-core' ),
                'option_2' => esc_html__( 'Option 2', 'ghostpool-core' ),
                'option_3' => esc_html__( 'Option 3', 'ghostpool-core' ),
             ),
        ),
    
    );  
  
    $settings[] = array(
        'id' => 'gp-custom-settings',
        'title' => esc_html__( 'Custom Settings', 'aardvark' ),
        'post_types' => array( 'all' ),
        'exclude_post_types' => array( 'elementor_library', 'gp_theme_template' ),
        'position' => 'normal',
        'priority' => 'high',
        'section' => $custom
    );
    return $settings;
}
add_filter( 'ghostpool_metaboxes_settings', 'ghostpool_custom_meta_boxes' );

Replacing "gp_setting_id_1" and gp_setting_id_2 with your own IDs. Also change the title, field type and desc for each settings.