Skip to content

Commit 2e739e8

Browse files
authored
Changelog, document post type filter
1 parent 4d87c8c commit 2e739e8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,22 @@ $post_type_object = get_post_type_object( $post_type ); ?>
7171
<li><a href="<?php echo get_post_type_archive_link( $post_type ); ?>"><?php echo $post_type_object->label; ?></a></li>
7272
```
7373

74+
### Filter available post types
75+
By default, only post types with parameter `public` will be shown. If you need to show non-public post types use the filter `post_type_selector_post_types` as described below. This filter also allows you to remove post types from the list.
76+
```
77+
add_filter( 'post_type_selector_post_types', function( $post_types, $fields ) {
78+
$post_types['foo'] = get_post_type_object( 'foo' );
79+
unset( $post_types['post'] );
80+
return $post_types;
81+
}, 10, 2 );
82+
```
83+
7484
## Changelog
85+
### 1.0.1
86+
* Filter available post types
87+
7588
### 1.0.0
76-
* Support for v5
89+
* Support for ACF `v5`
7790

7891
### 0.0.1
7992
* Initial Release.

0 commit comments

Comments
 (0)