Skip to content

Commit

Permalink
Update Changelog and Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gchtr committed Mar 6, 2019
1 parent c13ed11 commit ab399f5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Types

## 2.3.0 - 2019-03-06

- Added new `Types\Post_Type_Page` class. This class allows you to define a page that should act as the archive for a Custom Post Type [using the `page_for_archive` option](https://github.com/mindkomm/types#page_for_archive).
- Fixed a bug with an undefined function #2 (Thanks @roylodder).

## 2.2.3 - 2019-01-17

- Added new post type labels (<https://make.wordpress.org/core/2018/12/05/new-post-type-labels-in-5-0/>).
Expand Down
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ Custom Post Types and Taxonomy helper classes for WordPress projects.

- [Installation](#installation)
- [Register post types](#register-post-types)
- [query](#query)
- [admin_columns](#admin_columns)
- [page_for_archive](#page_for_archive)
- [Update existing post types](#update-existing-post-types)
- [Change settings for a post type](#change-settings-for-a-post-type)
- [Change post type support](#change-post-type-support)
- [Rename a post type](#rename-a-post-type)
- [Change admin column settings for existing post type](#change-admin-column-settings-for-existing-post-type)
- [Change settings for a post type](#change-settings-for-a-post-type)
- [Change post type support](#change-post-type-support)
- [Rename a post type](#rename-a-post-type)
- [Change admin column settings for existing post type](#change-admin-column-settings-for-existing-post-type)
- [Register taxonomies](#register-taxonomies)
- [Options](#options)
- [Options](#options)
- [Update existing taxonomies](#update-existing-taxonomies)
- [Change settings for a taxonomy](#change-settings-for-a-taxonomy)
- [Rename a taxonomy](#rename-a-taxonomy)
- [Unregister taxonomies](#unregister-taxonomies)
- [Change settings for a taxonomy](#change-settings-for-a-taxonomy)
- [Rename a taxonomy](#rename-a-taxonomy)
- [Unregister taxonomies](#unregister-taxonomies)
- [Customize a post slug](#customize-a-post-slug)

## Installation
Expand Down Expand Up @@ -164,6 +167,30 @@ You can also set the width and height. The defaults are `80` &times; `80` pixels

If you need more possibilities for defining admin columns you could use the fantastic [Admin Columns](https://www.admincolumns.com/) plugin.

### page_for_archive

The `page_for_archive` option allows you to set a specific page as the archive page for a custom post type:

```php
'partner' => [
'args' => [
'public' => true,
],
'page_for_archive' => [
'post_id' => get_option( 'page_for_partner' ),
'is_singular_public' => false,
],
],
```

In this example, the ID for the page that’s saved in the `page_for_partner` option will act as the archive page for the `partner` post type.

You need to **flush your permalinks** whenever you make changes to this option.

Behind the curtains, Types uses the `has_archive` option when registering a post type and set the slug of the page you passed in the `page_for_archive` option.

The `is_singular_public` option allows you to set, whether singular templates for this post type should be accessible in the frontend. Singular template requests will then be redirected to the archive page. We can’t use the `public` or `publicly_queryable` option for this, because then the archive page wouldn’t work either.

## Update existing post types

### Change settings for a post type
Expand Down

0 comments on commit ab399f5

Please sign in to comment.