Welcome, visitor! Log in
 

WordPress hook directory
{$new_status}_{$post->post_type}

Important warning about variable hooks

Some hooks have variables in their names. For example, pre_${taxonomy}_$field and admin_head- both have variable names. In general, any hook that ends (or begins) with - or _, or contains a $, has a variable name. Since the syntax with which these variables are defined may change from version to version, this page may think that a hook is deprecated (or new) even if it is not. You can usually catch this sort of thing by comparing this hook to the list of "related hooks" below.

Former names for {$new_status}_{$post->post_type}

This is a variable hook. Because its name contains some variables, this hook might actually refer to several different possible hooks.

This variable hook replaces the following non-variable hooks found in earlier versions of WP. You may want to read up on these older hooks to get a better idea of what this variable hook can do.

Replaced Hook Version when Changed Information about Hook
publish_page2.3Runs when a page is published, or if it is edited and its status is "published". Action function arguments: page ID. (WARNING: this hook seems to never fire on v2.3 and higher. The 'transition_post_status' hook does work though; UPDATE : publish_page hook appears to be working as of 2.6) Sources: [1] and [2]
publish_post2.3Runs when a post is published, or if it is edited and its status is "published". Action function arguments: post ID. Sources: [1] and [2]

WordPress version history for {$new_status}_{$post->post_type}

This database has information for all major versions from WP 1.2.1 through 3.9.

Version File Line Type
2.3 wp-includes/post.php 877 View hook in source action
2.5 wp-includes/post.php 1517 View hook in source action
2.6 wp-includes/post.php 1629 View hook in source action
2.7 wp-includes/post.php 1746 View hook in source action
2.8 wp-includes/post.php 1905 View hook in source action
2.9 wp-includes/post.php 2123 View hook in source action
3.0 wp-includes/post.php 2711 View hook in source action
3.1 wp-includes/post.php 2953 View hook in source action
3.2 wp-includes/post.php 2987 View hook in source action
3.3 wp-includes/post.php 2980 View hook in source action
3.4 wp-includes/post.php 3026 View hook in source action
3.5 wp-includes/post.php 3263 View hook in source action
3.6 wp-includes/post.php 3237 View hook in source action
3.7 wp-includes/post.php 3314 View hook in source action
3.8 wp-includes/post.php 3321 View hook in source action
3.9 wp-includes/post.php 3689 View hook in source action

Related Hooks

We find related hooks using word stems. {$new_status}_{$post->post_type} has 5 significant word stem(s): new, status, post, post, type. Note that some of the hooks below may not appear in all versions of WP.