/** * Registers the custom post type for builder templates. * * @since 1.1.3 * @since 1.5.7 Added template category taxonomy. * @return void */ public static function register_templates_post_type() { // Template classes aren't included in the lite version. if (FL_BUILDER_LITE === true) { return; } // Get the array of supported features for the templates post type. $supports = array('title', 'revisions', 'page-attributes'); // Include thumbnail support if core templates can be overridden. if (class_exists('FLBuilderTemplatesOverride')) { $supports[] = 'thumbnail'; } // Register the template post type. register_post_type('fl-builder-template', array('public' => FLBuilderModel::is_user_templates_admin_enabled() ? true : false, 'labels' => array('name' => _x('Templates', 'Custom post type label.', 'fl-builder'), 'singular_name' => _x('Template', 'Custom post type label.', 'fl-builder'), 'menu_name' => _x('Templates', 'Custom post type label.', 'fl-builder'), 'name_admin_bar' => _x('Template', 'Custom post type label.', 'fl-builder'), 'add_new' => _x('Add New', 'Custom post type label.', 'fl-builder'), 'add_new_item' => _x('Add New Template', 'Custom post type label.', 'fl-builder'), 'new_item' => _x('New Template', 'Custom post type label.', 'fl-builder'), 'edit_item' => _x('Edit Template', 'Custom post type label.', 'fl-builder'), 'view_item' => _x('View Template', 'Custom post type label.', 'fl-builder'), 'all_items' => _x('All Templates', 'Custom post type label.', 'fl-builder'), 'search_items' => _x('Search Templates', 'Custom post type label.', 'fl-builder'), 'parent_item_colon' => _x('Parent Templates:', 'Custom post type label.', 'fl-builder'), 'not_found' => _x('No templates found.', 'Custom post type label.', 'fl-builder'), 'not_found_in_trash' => _x('No templates found in Trash.', 'Custom post type label.', 'fl-builder')), 'menu_icon' => 'dashicons-welcome-widgets-menus', 'supports' => $supports, 'taxonomies' => array('fl-builder-template-category'), 'publicly_queryable' => true, 'exclude_from_search' => true)); // Register the template taxonomy. register_taxonomy('fl-builder-template-category', array('fl-builder-template'), array('labels' => array('name' => _x('Categories', 'Custom taxonomy label.', 'fl-builder'), 'singular_name' => _x('Category', 'Custom taxonomy label.', 'fl-builder'), 'search_items' => _x('Search Categories', 'Custom taxonomy label.', 'fl-builder'), 'all_items' => _x('All Categories', 'Custom taxonomy label.', 'fl-builder'), 'parent_item' => _x('Parent Category', 'Custom taxonomy label.', 'fl-builder'), 'parent_item_colon' => _x('Parent Category:', 'Custom taxonomy label.', 'fl-builder'), 'edit_item' => _x('Edit Category', 'Custom taxonomy label.', 'fl-builder'), 'update_item' => _x('Update Category', 'Custom taxonomy label.', 'fl-builder'), 'add_new_item' => _x('Add New Category', 'Custom taxonomy label.', 'fl-builder'), 'new_item_name' => _x('New Category Name', 'Custom taxonomy label.', 'fl-builder'), 'menu_name' => _x('Categories', 'Custom taxonomy label.', 'fl-builder')), 'hierarchical' => true, 'public' => true, 'show_admin_column' => true)); }