register_(post_type)_post_type_args хук-фильтрWP 6.0.0

Filters the arguments for registering a specific post type.

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

Possible hook names include:

Использование

add_filter( 'register_(post_type)_post_type_args', 'wp_kama_register_post_type_args_filter', 10, 2 );

/**
 * Function for `register_(post_type)_post_type_args` filter-hook.
 * 
 * @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.
 *
 * @return array
 */
function wp_kama_register_post_type_args_filter( $args, $post_type ){

	// filter...
	return $args;
}
$args(массив)
Array of arguments for registering a post type. See the register_post_type() function for accepted arguments.
$post_type(строка)
Post type key.

Список изменений

С версии 6.0.0 Введена.

Где вызывается хук

WP_Post_Type::set_props()
register_(post_type)_post_type_args
wp-includes/class-wp-post-type.php 461
$args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name );

Где используется хук в WordPress

Использование не найдено.