Filter hook 'xmlrpc_prepare_comment'

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

View Source

xmlrpc_prepare_comment

Filter Hook
Description
Filters XML-RPC-prepared data for the given comment.

Hook Information

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

Hook Parameters

Type Name Description
array $_comment An array of prepared comment data.
WP_Comment $comment Comment object.

Usage Examples

Basic Usage
<?php
// Hook into xmlrpc_prepare_comment
add_filter('xmlrpc_prepare_comment', 'my_custom_filter', 10, 2);

function my_custom_filter($_comment, $comment) {
    // Your custom filtering logic here
    return $_comment;
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:1227 - How this hook is used in WordPress core
<?php
1222  		 * @since 3.4.0
1223  		 *
1224  		 * @param array      $_comment An array of prepared comment data.
1225  		 * @param WP_Comment $comment  Comment object.
1226  		 */
1227  		return apply_filters( 'xmlrpc_prepare_comment', $_comment, $comment );
1228  	}
1229  
1230  	/**
1231  	 * Prepares user data for return in an XML-RPC object.
1232  	 *

PHP Documentation

<?php
/**
		 * Filters XML-RPC-prepared data for the given comment.
		 *
		 * @since 3.4.0
		 *
		 * @param array      $_comment An array of prepared comment data.
		 * @param WP_Comment $comment  Comment object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks

Related hooks will be displayed here in future updates.