bobbingwide / oik-types

oik custom content type manager
http://www.oik-plugins.com/oik-plugins/oik-types/
GNU General Public License v2.0
1 stars 0 forks source link

Respond to the 'register_post_type_args' filter function in WordPress 4.4 #3

Open bobbingwide opened 8 years ago

bobbingwide commented 8 years ago

In WordPress TRAC 17447 (see https://core.trac.wordpress.org/ticket/17447#comment:60 ) a new filter called register_post_type_args was added to the register_post_type API. We should take advantage of this filter to apply the oik-types overrides to the post type before it's registered.

This will allow post type overrides, such as setting has_archive to true, to be effective. Before WP 4.4, switching the has_archive flag wasn't easy... if done after the post type registration it would have required changing rewrite rules. So we didn't actually implement it. Now it should be a cinch.

bobbingwide commented 8 years ago

There may be two parts to this.

  1. Respond to the filter when invoked
  2. When updating posts types there may be no need to re-apply overrides