Skip to content

Commit

Permalink
Changelog, document post type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrann0us authored Apr 11, 2018
1 parent 4d87c8c commit 2e739e8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,22 @@ $post_type_object = get_post_type_object( $post_type ); ?>
<li><a href="<?php echo get_post_type_archive_link( $post_type ); ?>"><?php echo $post_type_object->label; ?></a></li>
```

### Filter available post types
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.
```
add_filter( 'post_type_selector_post_types', function( $post_types, $fields ) {
$post_types['foo'] = get_post_type_object( 'foo' );
unset( $post_types['post'] );
return $post_types;
}, 10, 2 );
```

## Changelog
### 1.0.1
* Filter available post types

### 1.0.0
* Support for v5
* Support for ACF `v5`

### 0.0.1
* Initial Release.

0 comments on commit 2e739e8

Please sign in to comment.