wppaste
WordPress

_publish_post_hook( int $post_id )

Since
2.3.0
Source
wp-includes/post.php:7910
Hook to schedule pings and enclosures when a post is published.

Description

Uses XMLRPC_REQUEST and WP_IMPORTING constants.

Parameters

$post_idint
The ID of the post being published.

Hooks fired · 1

One hook fires while _publish_post_hook() runs, in this order:

  1. do_action( xmlrpc_publish_post )actionline 7919 (+9 into the body)

    Fires when _publish_post_hook() is called during an XML-RPC request.

Uses · 6

Source

function _publish_post_hook( $post_id ) {	if ( defined( 'XMLRPC_REQUEST' ) ) {		/**		 * Fires when _publish_post_hook() is called during an XML-RPC request.		 *		 * @since 2.1.0		 *		 * @param int $post_id Post ID.		 */		do_action( 'xmlrpc_publish_post', $post_id );	} 	if ( defined( 'WP_IMPORTING' ) ) {		return;	} 	if ( get_option( 'default_pingback_flag' ) ) {		add_post_meta( $post_id, '_pingme', '1', true );	}	add_post_meta( $post_id, '_encloseme', '1', true ); 	$to_ping = get_to_ping( $post_id );	if ( ! empty( $to_ping ) ) {		add_post_meta( $post_id, '_trackbackme', '1' );	} 	if ( ! wp_next_scheduled( 'do_pings' ) ) {		wp_schedule_single_event( time(), 'do_pings' );	}}

History

Introduced in 2.3.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.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/post.php, 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.