esc_html__( 'Builder Header Footer', 'post type general name', 'ova-framework' ), 'singular_name' => esc_html__( 'Builder Header Footer', 'post type singular name', 'ova-framework' ), 'menu_name' => esc_html__( 'Builder Header Footer', 'admin menu', 'ova-framework' ), 'name_admin_bar' => esc_html__( 'HF', 'add new on admin bar', 'ova-framework' ), 'add_new' => esc_html__( 'Add New HF', 'Slide', 'ova-framework' ), 'add_new_item' => esc_html__( 'Add New HF', 'ova-framework' ), 'new_item' => esc_html__( 'New HF', 'ova-framework' ), 'edit_item' => esc_html__( 'Edit HF', 'ova-framework' ), 'view_item' => esc_html__( 'View HF', 'ova-framework' ), 'all_items' => esc_html__( 'All HF', 'ova-framework' ), 'search_items' => esc_html__( 'Search HF', 'ova-framework' ), 'parent_item_colon' => esc_html__( 'Parent HF:', 'ova-framework' ), 'not_found' => esc_html__( 'No HF found.', 'ova-framework' ), 'not_found_in_trash' => esc_html__( 'No HF found in Trash.', 'ova-framework' ), ); $args = array( 'labels' => $labels, 'public' => true, 'rewrite' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_icon' => 'dashicons-editor-kitchensink', 'supports' => array( 'title', 'elementor' ), ); register_post_type( 'ova_framework_hf_el', $args ); } public function block_template_frontend() { if ( is_singular( 'ova_framework_hf_el' ) && ! current_user_can( 'edit_posts' ) ) { wp_redirect( site_url(), 301 ); die; } } /* Single of ova_framework_hf_el will only display in elementor */ public function ova_load_canvas_template( $single_template ) { global $post; if ( 'ova_framework_hf_el' == $post->post_type ) { $elementor_2_0_canvas = ELEMENTOR_PATH . 'modules/page-templates/templates/canvas.php'; if ( file_exists( $elementor_2_0_canvas ) ) { return $elementor_2_0_canvas; } else { return ELEMENTOR_PATH . '/includes/page-templates/canvas.php'; } } return $single_template; } /** * Meta box initialization. */ public function init_metabox() { add_action( 'add_meta_boxes', array( $this, 'add_metabox' ) ); add_action( 'save_post', array( $this, 'save_metabox' ), 10, 2 ); } /** * Adds the meta box. */ public function add_metabox() { add_meta_box( 'hf_el', esc_html__( 'Elementor Header Footer Option', 'ova-framework' ), array( $this, 'ova_render_metabox' ), 'ova_framework_hf_el', 'normal', 'high' ); } /** * Renders the meta box. */ public function ova_render_metabox( $post ) { // Add nonce for security and authentication. $value = get_post_meta($post->ID, 'hf_options', true); ?> esc_html__( 'Theme', 'ova-framework' ), ); } return $post_templates; } } } return new OVA_HF_Builder();