Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access pages directly.
- function factorian_theme_metabox($options ){
- $options = array(); // remove old options
- // -----------------------------------------
- // Page Metabox Options -
- // -----------------------------------------
- $options[] = array(
- 'id' => 'factorian_page_options',
- 'title' => 'Page Options',
- 'post_type' => 'page',
- 'context' => 'normal',
- 'priority' => 'high',
- 'sections' => array(
- // begin: a section
- array(
- 'name' => 'factorian_page_options_meta',
- 'icon' => 'fa fa-cog',
- // begin: fields
- 'fields' => array(
- // begin: a field
- array(
- 'id' => 'enable_title',
- 'type' => 'switcher',
- 'title' => 'Enable Title',
- 'default' => true,
- 'desc' => esc_html__('If you want to enable title, select yes','factorian-rrf'),
- ),
- array(
- 'id' => 'enable_content',
- 'type' => 'switcher',
- 'title' => 'Enable content',
- 'default' => false,
- 'desc' => esc_html__('If you want to enable Content, select yes','factorian-rrf'),
- )
- ), // end: fields
- ), // end: a section
- ),
- );
- // -----------------------------------------
- // Factorian Slide Options -
- // -----------------------------------------
- $options[] = array(
- 'id' => 'factorian_slide_options',
- 'title' => 'Slide Options',
- 'post_type' => 'slide',
- 'context' => 'normal',
- 'priority' => 'high',
- 'sections' => array(
- // begin: a section
- array(
- 'name' => 'factorian_slide_options_meta',
- // begin: fields
- 'fields' => array(
- array(
- 'id' => 'buttons',
- 'type' => 'group',
- 'title' => 'Slide Buttons',
- 'button_title' => 'Add New',
- 'accordion_title' => 'Add New Button',
- 'fields' => array(
- array(
- 'id' => 'type',
- 'type' => 'select',
- 'title' => 'Select Button',
- 'desc' => 'Select Button Type',
- 'options' => array(
- 'bordered' => 'Borderd Button',
- 'filled' => 'Filled Button',
- 'boxed' => 'Boxed Button',
- ),
- ),
- array(
- 'id' => 'text',
- 'type' => 'text',
- 'title' => 'Button Text',
- 'desc' => 'Type Button Text',
- 'default' => 'Get free consultation',
- ),
- array(
- 'id' => 'link_type',
- 'type' => 'select',
- 'title' => 'Link Type',
- 'desc' => 'Select Link Type',
- 'options' => array(
- '1' => 'WordPress page',
- '2' => 'External link',
- ),
- ),
- array(
- 'id' => 'link_to_page',
- 'type' => 'select',
- 'title' => 'Select Page',
- 'desc' => 'Select a Page',
- 'options' => 'page',
- 'dependency' => array( 'link_type', '==', '1' ),
- ),
- array(
- 'id' => 'link_to_expernal',
- 'type' => 'text',
- 'title' => 'Type URL',
- 'desc' => 'Type a valid URL',
- 'dependency' => array( 'link_type', '==', '2' ),
- ),
- ),
- ),
- array(
- 'id' => 'enable_overlay',
- 'type' => 'switcher',
- 'default' => true,
- 'title' => 'Enable Overlay!',
- 'desc' => 'Select Overlay Type',
- ),
- array(
- 'id' => 'overlay_percentage', // this is must be unique
- 'type' => 'text',
- 'default' => .5,
- 'title' => 'Overlay percentage',
- 'desc' => 'Type Overlay percentage in Floating Number. Max value is 1.',
- 'dependency' => array( 'enable_overlay', '==', 'true' ),
- ),
- array(
- 'id' => 'overlay_color',
- 'type' => 'color_picker',
- 'default' => '#181a1f',
- 'title' => 'Overlay Color ',
- 'desc' => 'Select Overlay Color ',
- 'dependency' => array( 'enable_overlay', '==', 'true' ),
- ),
- ), // end: fields
- ), // end: a section
- ),
- );
- return $options;
- }
- add_filter( 'cs_metabox_options', 'factorian_theme_metabox' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement