wppaste
WordPress

apply_filters( "register_{$post_type}_post_type_args", array $args, string $post_type )

Since
6.0.0, 6.4.0
Filters the arguments for registering a specific post type.

Description

The dynamic portion of the filter name, $post_type, refers to the post type key.

Possible hook names include:

  • register_post_post_type_args
  • register_page_post_type_args

Compatibility

WordPress
since 6.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$argsarray
Array of arguments for registering a post type.
See the register_post_type() function for accepted arguments.
$post_typestring
Post type key.

Where this hook fires · 1

  • wp-includes/class-wp-post-type.php:523WP_Post_Type::set_props()

Source code

		 * @since 6.4.0 Added `late_route_registration`, `autosave_rest_controller_class` and `revisions_rest_controller_class` arguments.		 *		 * @param array  $args      Array of arguments for registering a post type.		 *                          See the register_post_type() function for accepted arguments.		 * @param string $post_type Post type key.		 */		$args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name ); 		$has_edit_link = ! empty( $args['_edit_link'] ); 		// Args prefixed with an underscore are reserved for internal use.		$defaults = array(			'labels'                          => array(),

Changelog

Introduced in 6.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.4.0
Added late_route_registration, autosave_rest_controller_class and revisions_rest_controller_class arguments.from the docblock
6.0.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.