array( 'name' => __( 'Custom blocks', 'cpod-kit' ), 'singular_name' => __( 'Custom block', 'cpod-kit' ), 'menu_name' => __( 'Custom Blocks', 'cpod-kit' ), 'all_items' => __( 'Custom Blocks', 'cpod-kit' ), 'add_new' => __( 'Add custom block', 'cpod-kit' ), 'add_new_item' => __( 'Add new custom block', 'cpod-kit' ), 'edit_item' => __( 'Edit custom block', 'cpod-kit' ), 'new_item' => __( 'New custom block', 'cpod-kit' ), 'search_items' => __( 'Search custom blocks', 'cpod-kit' ), 'not_found' => __( 'No custom blocks yet.', 'cpod-kit' ), 'not_found_in_trash' => __( 'No custom blocks in the trash.', 'cpod-kit' ), 'item_published' => __( 'Custom block published.', 'cpod-kit' ), 'item_updated' => __( 'Custom block updated.', 'cpod-kit' ), 'item_reverted_to_draft' => __( 'Custom block reverted to draft.', 'cpod-kit' ), ), 'public' => false, 'show_ui' => true, 'show_in_menu' => \CPODKit\Core\Admin\Menu::SLUG, // The block editor works through the REST API. 'show_in_rest' => true, 'rest_base' => 'cpod-blocks', 'capability_type' => 'product', 'map_meta_cap' => true, 'hierarchical' => false, 'supports' => array( 'title', 'editor', 'revisions' ), 'rewrite' => false, 'query_var' => false, ) ); } /** Keep the block editor even when a plugin such as Classic Editor turns it off. */ public function use_block_editor( $use, $post_type ) { return self::NAME === $post_type ? (bool) apply_filters( 'cpod_block_use_block_editor', true ) : $use; } }