Action hook 'xmlrpc_publish_post'

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

View Source

xmlrpc_publish_post

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

Hook Information

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

Hook Parameters

Type Name Description
int $post_id Post ID.

Usage Examples

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

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

Source Code Context

wp-includes/post.php:7919 - How this hook is used in WordPress core
<?php
7914  		 *
7915  		 * @since 2.1.0
7916  		 *
7917  		 * @param int $post_id Post ID.
7918  		 */
7919  		do_action( 'xmlrpc_publish_post', $post_id );
7920  	}
7921  
7922  	if ( defined( 'WP_IMPORTING' ) ) {
7923  		return;
7924  	}

PHP Documentation

<?php
/**
		 * Fires when _publish_post_hook() is called during an XML-RPC request.
		 *
		 * @since 2.1.0
		 *
		 * @param int $post_id Post ID.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.