Action hook 'unregistered_post_type'

in WP Core File wp-includes/post.php at line 1891

View Source

unregistered_post_type

Action Hook
Description
Fires after a post type was unregistered.

Hook Information

File Location wp-includes/post.php View on GitHub
Hook Type Action
Line Number 1891

Hook Parameters

Type Name Description
string $post_type Post type key.

Usage Examples

Basic Usage
<?php
// Hook into unregistered_post_type
add_action('unregistered_post_type', 'my_custom_function', 10, 1);

function my_custom_function($post_type) {
    // Your custom code here
}

Source Code Context

wp-includes/post.php:1891 - How this hook is used in WordPress core
<?php
1886  	 *
1887  	 * @since 4.5.0
1888  	 *
1889  	 * @param string $post_type Post type key.
1890  	 */
1891  	do_action( 'unregistered_post_type', $post_type );
1892  
1893  	return true;
1894  }
1895  
1896  /**

PHP Documentation

<?php
/**
	 * Fires after a post type was unregistered.
	 *
	 * @since 4.5.0
	 *
	 * @param string $post_type Post type key.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.