Skip to content

Commit

Permalink
✨ Display all post types for pattern
Browse files Browse the repository at this point in the history
Closes #26
  • Loading branch information
MatzeKitt committed Aug 30, 2024
1 parent 0e33989 commit 3c40886
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/control/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,13 @@ const addControls = createHigherOrderComponent( ( BlockEdit ) => {
{ Object.keys( blockControlStore.posts ).map( ( type, i ) => {
// display this post type only
// if we currently aren't in a specific post type
if ( postType && postType !== type ) {
// but display all post types for patterns
if ( postType && postType !== type && postType !== 'wp_block' ) {
return null;
}

return (
<div className="block-control-control-area block-control-control-hide-posts" key={ type + i }>
<div className={ 'block-control-control-area block-control-control-hide-posts is-type-' + type } key={ type + i }>
{/* translators: plural post type title */}
<span className="components-base-control__label">{ sprintf( __( 'Hide for post type "%s"', 'block-control' ), blockControlStore.posts[ type ]['title'] ) }</span>

Expand Down

0 comments on commit 3c40886

Please sign in to comment.