register_attesa_templates(); } protected function register_attesa_templates() { $labels = array( 'name' => _x( 'Attesa Templates', 'post type general name', 'attesa-extra' ), 'singular_name' => _x( 'Template', 'post type singular name', 'attesa-extra' ), 'menu_name' => _x( 'Templates', 'admin menu', 'attesa-extra' ), 'name_admin_bar' => _x( 'Templates', 'add new on admin bar', 'attesa-extra' ), 'add_new' => _x( 'Add New', 'template', 'attesa-extra' ), 'add_new_item' => __('Add New Template', 'attesa-extra'), 'new_item' => __('New Template', 'attesa-extra'), 'edit_item' => __('Edit Template', 'attesa-extra'), 'all_items' => __('All Templates', 'attesa-extra'), 'view_item' => __('View Template', 'attesa-extra'), 'search_items' => __('Search Templates', 'attesa-extra'), 'not_found' => __('No Template found', 'attesa-extra'), 'not_found_in_trash' => __('No Template found in trash', 'attesa-extra'), ); $args = array( 'labels' => $labels, 'public' => true, 'hierarchical' => false, 'show_ui' => true, 'show_in_menu' => false, 'show_in_nav_menus' => false, 'can_export' => true, 'exclude_from_search' => true, 'capability_type' => 'post', 'rewrite' => false, 'show_in_rest' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'author', 'elementor' ), ); register_post_type('attesa_templates', $args); } public function attesaextra_templates_menu() { add_submenu_page( 'attesa-welcome', esc_html__( 'Attesa Templates', 'attesa-extra' ), esc_html__( 'Custom Templates', 'attesa-extra' ), 'manage_options', 'edit.php?post_type=attesa_templates'); } public function register_meta_box($post) { add_meta_box( 'attesa-extra-templates-shortcode', esc_html__( 'Template Shortcode', 'attesa-extra' ), array( $this, 'metabox_options' ), 'attesa_templates', 'side', 'high', null ); } public function metabox_options($post) { ?>