Title: Object type specific registration hooks in 6.0
Author: Milana Cap
Published: May 2, 2022
Last modified: May 3, 2022

---

 [  ](https://profiles.wordpress.org/milana_cap/) [Milana Cap](https://profiles.wordpress.org/milana_cap/)
1:26 pm _on_ May 2, 2022     
Tags: [6.0 ( 76 )](https://make.wordpress.org/core/tag/6-0/),
[dev-notes ( 647 )](https://make.wordpress.org/core/tag/dev-notes/), [dev-notes-6.0 ( 20 )](https://make.wordpress.org/core/tag/dev-notes-6-0/)

# Object type specific registration hooks in 6.0

If you’ve ever worked with post types in WordPress, chances are you’ve used `register_post_type_args`
filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. where you had to perform post type check. In WordPress 6.0 you won’t have
to do that any more as new object type hooksHooks In WordPress theme and development,
hooks are functions that can be applied to an action or a Filter in WordPress. Actions
are functions performed when a certain event occurs in WordPress. Filters allow 
you to modify certain functions. Arguments used to hook both filters and actions
look the same. are introduced.

Similar to other dynamic hooks, these will allow you to directly hook into your 
custom post types and custom taxonomies.

New filters:

 * `register_{$post_type}_post_type_args `– Filters the arguments for registering
   a specific post type.
 * `register_{$taxonomy}_taxonomy_args` – Filters the arguments for registering 
   a specific taxonomyTaxonomy A taxonomy is a way to group things together. In 
   WordPress, some common taxonomies are category, link, tag, or post format. [https://codex.wordpress.org/Taxonomies#Default_Taxonomies](https://codex.wordpress.org/Taxonomies#Default_Taxonomies)..

New actions:

 * `registered_post_type_{$post_type}` – Fires **_after_** a specific post type 
   is registered.
 * `registered_taxonomy_{$taxonomy}` – Fires **_after_** a specific taxonomy is 
   registered.

For more info see [#53212](https://core.trac.wordpress.org/ticket/53212).

[#6-0](https://make.wordpress.org/core/tag/6-0/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#dev-notes-6-0](https://make.wordpress.org/core/tag/dev-notes-6-0/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2022/05/02/object-type-specific-registration-hooks-in-6-0/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/8cf7655071f82970f9635a0c7e7646551756c333b57166083e506a72cad98916?
     s=32&d=mm&r=g)
 2.   [David Anderson](https://profiles.wordpress.org/davidanderson/)  1:55 pm _on_
     May 2, 2022
 3.  I don’t understand this. An extra filterFilter Filters are one of the two types
     of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
     They provide a way for functions to modify data of other functions. They are the
     counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
     manner, and should never have side effects such as affecting global variables 
     and output. to save 1 line of code – but not a good precedent, because either 
     now the same precedent should be applied everywhere, or we now have inconsistency
     in which some filters will have multiple versions to spare coders doing a 1-line
     check, and some won’t.
 4.   * ![](https://secure.gravatar.com/avatar/302e4aa5f4f537d66a3fae116fd93d32de1a1a4178680ee08ac021289127a3dd?
        s=32&d=mm&r=g)
      *  [wpexplorer](https://profiles.wordpress.org/wpexplorer/)  4:05 am _on_ May
        27, 2022
      * I totally agree. And if you are modifying multiple post types you would just
        stick to the original filterFilter Filters are one of the two types of Hooks
        [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
        They provide a way for functions to modify data of other functions. They are
        the counterpart to Actions. Unlike Actions, filters are meant to work in an
        isolated manner, and should never have side effects such as affecting global
        variables and output. and use a switch statement rather than multiple functions.
      * ![](https://secure.gravatar.com/avatar/ff75a9abbbd0a7cb3c8dac5d040917e40e9ea510f5aa22ff6e2320a9bab8a874?
        s=32&d=mm&r=g)
      *  [drzraf](https://profiles.wordpress.org/drzraf/)  1:28 pm _on_ May 27, 2022
      * New hooksHooks In WordPress theme and development, hooks are functions that
        can be applied to an action or a Filter in WordPress. Actions are functions
        performed when a certain event occurs in WordPress. Filters allow you to modify
        certain functions. Arguments used to hook both filters and actions look the
        same. are often good (and 6.0 is a new major version)… but in this case:
         - It’s a significant hook (which, if failing to run (on = WP 6.0 instead of
           a broader versions support.
 5.  ![](https://secure.gravatar.com/avatar/ff75a9abbbd0a7cb3c8dac5d040917e40e9ea510f5aa22ff6e2320a9bab8a874?
     s=32&d=mm&r=g)
 6.   [drzraf](https://profiles.wordpress.org/drzraf/)  1:30 pm _on_ May 27, 2022
 7.  ….
 8.   * It only spares one line and add nothing that couldn’t be accomplished before
 9.  It’s typical of a hook that will make easier, for careless pluginPlugin A plugin
     is a piece of software containing a group of functions that can be added to a 
     WordPress website. They can extend functionality or add new features to your WordPress
     websites. WordPress plugins are written in the PHP programming language and integrate
     seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory
     [https://wordpress.org/plugins/](https://wordpress.org/plugins/) or can be cost-
     based plugin from a third-party. developers, to quickly restrict their plugins
     to >= WP 6.0 only.

Comments are closed.

# Post navigation

[← Performance Chat Agenda: 3 May 2022](https://make.wordpress.org/core/2022/05/02/performance-chat-agenda-3-may-2022/)

[New features for working with patterns and themes in WordPress 6.0 →](https://make.wordpress.org/core/2022/05/02/new-features-for-working-with-patterns-and-themes-in-wordpress-6-0/)