Problem
When a post type is registered with show_ui: false and public: false, it cannot appear in the library upload post type picker. There is no way for external plugins to surface their own private post types in this list.
Two things need to change:
1. No filter hook exists on the $known allowlist
PostsRepository::get_types() has a hardcoded $known array for post types with show_ui: false that should still appear in the content browser:
$known = [
'wp_template',
'wp_template_part',
'fl_code',
];
There is no filter hook on this array, so external plugins have no way to opt their own private post types in without patching the assistant plugin directly.
2. The library upload UI filters by canView, which excludes private post types
Even if a post type were added to $known, the library upload UI in cloud-ui applies a second independent filter:
const types = typesData.filter( t => true === t[1].canView )
canView is set in the backend as public || publicly_queryable. Private post types always have canView: false and are silently dropped by the frontend before they can appear in the list.
Use Case
fl-design-system (the BB Design System CPT) is private (show_ui: false, public: false) but should be available in the library upload picker so design systems can be saved to an Assistant library.
Proposed Fix
In PostsRepository::get_types() — wrap $known in a filter so external plugins can opt in, and treat types in $known as viewable so they pass the frontend filter:
$known = apply_filters( 'fl_assistant_post_types_known', [
'wp_template',
'wp_template_part',
'fl_code',
] );
// ...
'canView' => $type->public || $type->publicly_queryable || in_array( $slug, $known ),
bb-design-system can then hook in without the assistant plugin needing to know about it directly:
add_filter( 'fl_assistant_post_types_known', function( $known ) {
$known[] = 'fl-design-system';
return $known;
} );
Files
backend/src/Data/Repository/PostsRepository.php — get_types(), $known array, canView flag
Problem
When a post type is registered with
show_ui: falseandpublic: false, it cannot appear in the library upload post type picker. There is no way for external plugins to surface their own private post types in this list.Two things need to change:
1. No filter hook exists on the
$knownallowlistPostsRepository::get_types()has a hardcoded$knownarray for post types withshow_ui: falsethat should still appear in the content browser:There is no filter hook on this array, so external plugins have no way to opt their own private post types in without patching the assistant plugin directly.
2. The library upload UI filters by
canView, which excludes private post typesEven if a post type were added to
$known, the library upload UI incloud-uiapplies a second independent filter:canViewis set in the backend aspublic || publicly_queryable. Private post types always havecanView: falseand are silently dropped by the frontend before they can appear in the list.Use Case
fl-design-system(the BB Design System CPT) is private (show_ui: false,public: false) but should be available in the library upload picker so design systems can be saved to an Assistant library.Proposed Fix
In
PostsRepository::get_types()— wrap$knownin a filter so external plugins can opt in, and treat types in$knownas viewable so they pass the frontend filter:bb-design-systemcan then hook in without the assistant plugin needing to know about it directly:Files
backend/src/Data/Repository/PostsRepository.php—get_types(),$knownarray,canViewflag