Action hook 'xmlrpc_call_success_wp_newComment'

in WP Core File wp-includes/class-wp-xmlrpc-server.php at line 4045

View Source

xmlrpc_call_success_wp_newComment

Action Hook
Description
Fires after a new comment has been successfully created via XML-RPC.

Hook Information

File Location wp-includes/class-wp-xmlrpc-server.php View on GitHub
Hook Type Action
Line Number 4045

Hook Parameters

Type Name Description
int $comment_id ID of the new comment.
array $args An array of new comment arguments.

Usage Examples

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

function my_custom_function($comment_id, $args) {
    // Your custom code here
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:4045 - How this hook is used in WordPress core
<?php
4040  		 * @since 3.4.0
4041  		 *
4042  		 * @param int   $comment_id ID of the new comment.
4043  		 * @param array $args       An array of new comment arguments.
4044  		 */
4045  		do_action( 'xmlrpc_call_success_wp_newComment', $comment_id, $args ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase
4046  
4047  		return $comment_id;
4048  	}
4049  
4050  	/**

PHP Documentation

<?php
/**
		 * Fires after a new comment has been successfully created via XML-RPC.
		 *
		 * @since 3.4.0
		 *
		 * @param int   $comment_id ID of the new comment.
		 * @param array $args       An array of new comment arguments.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks

Related hooks will be displayed here in future updates.