true ) ); $screen = get_current_screen(); $post_type = $screen->id; if ( in_array( $post_type, ( array ) $post_types ) ) { wp_enqueue_style( 'develope-layout-metabox', get_template_directory_uri() . '/css/admin/meta-box.css', array(), DEVELOPE_VERSION ); } } } add_action( 'add_meta_boxes', 'develope_register_layout_meta_box' ); /** * Generate the layout metabox * * @since 2.0 */ function develope_register_layout_meta_box() { if ( ! current_user_can( apply_filters( 'develope_metabox_capability', 'edit_theme_options' ) ) ) { return; } if ( ! defined( 'DEVELOPE_LAYOUT_META_BOX' ) ) { define( 'DEVELOPE_LAYOUT_META_BOX', true ); } $post_types = get_post_types( array( 'public' => true ) ); foreach ( $post_types as $type ) { if ( 'attachment' !== $type ) { add_meta_box( 'develope_layout_options_meta_box', esc_html__( 'Layout', 'developress' ), 'develope_do_layout_meta_box', $type, 'side' ); } } } /** * Build our meta box. * * @since 2.0 * * @param object $post All post information. */ function develope_do_layout_meta_box( $post ) { wp_nonce_field( basename( __FILE__ ), 'develope_layout_nonce' ); $stored_meta = (array) get_post_meta( $post->ID ); $stored_meta['_develope-sidebar-layout-meta'][0] = ( isset( $stored_meta['_develope-sidebar-layout-meta'][0] ) ) ? $stored_meta['_develope-sidebar-layout-meta'][0] : ''; $stored_meta['_develope-footer-widget-meta'][0] = ( isset( $stored_meta['_develope-footer-widget-meta'][0] ) ) ? $stored_meta['_develope-footer-widget-meta'][0] : ''; $stored_meta['_develope-full-width-content'][0] = ( isset( $stored_meta['_develope-full-width-content'][0] ) ) ? $stored_meta['_develope-full-width-content'][0] : ''; $stored_meta['_develope-disable-headline'][0] = ( isset( $stored_meta['_develope-disable-headline'][0] ) ) ? $stored_meta['_develope-disable-headline'][0] : ''; $tabs = apply_filters( 'develope_metabox_tabs', array( 'sidebars' => array( 'title' => esc_html__( 'Sidebars', 'developress' ), 'target' => '#develope-layout-sidebars', 'class' => 'current', ), 'footer_widgets' => array( 'title' => esc_html__( 'Footer Widgets', 'developress' ), 'target' => '#develope-layout-footer-widgets', 'class' => '', ), 'disable_elements' => array( 'title' => esc_html__( 'Disable Elements', 'developress' ), 'target' => '#develope-layout-disable-elements', 'class' => '', ), 'container' => array( 'title' => esc_html__( 'Page Builder Container', 'developress' ), 'target' => '#develope-layout-page-builder-container', 'class' => '', ), ) ); ?>