wp-papi / papi

:rocket: WordPress Page Type API with custom fields
https://wp-papi.github.io
MIT License
263 stars 32 forks source link

Auto detect "only page type" when only one page type exists for a post type #203

Closed frozzare closed 7 years ago

frozzare commented 8 years ago

Today the Add New menu item can detect this, only_page_type filter should be also be able to this so developers don't have to use the filter when only one page type exists for a post type and standard page isn't used. The filter should still work but shouldn't be required anymore.

add_filter( 'papi/settings/only_page_type_post', function () {
  return 'post-page-type';
} );

This should also be done for taxonomies.