Make WordPress Core


Ignore:
Timestamp:
04/11/2022 05:09:53 AM (4 years ago)
Author:
peterwilsoncc
Message:

Posts, Post Types/Taxonomies: Add object type specific registration filters.

Add post type and taxonomy specific registration argument hooks.

Introduces the filters register_{$post_type}_post_type_args and register_{$taxonomy}_taxonomy_args. Introduces the actions registered_post_type_{$post_type} and registered_taxonomy_{$taxonomy}.

Props pbiron, dlh, davidbaumwald, hellofromTonya, milana_cap.
Fixes #53212.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r53060 r53126  
    17101710        do_action( 'registered_post_type', $post_type, $post_type_object );
    17111711
     1712        /**
     1713         * Fires after a specific post type is registered.
     1714         *
     1715         * The dynamic portion of the filter name, `$post_type`, refers to the post type key.
     1716         *
     1717         * @since 6.0.0
     1718         *
     1719         * @param string       $post_type        Post type.
     1720         * @param WP_Post_Type $post_type_object Arguments used to register the post type.
     1721         */
     1722        do_action( "registered_post_type_{$post_type}", $post_type, $post_type_object );
     1723
    17121724        return $post_type_object;
    17131725}
Note: See TracChangeset for help on using the changeset viewer.