wp_comment_reply
Filters the in-line comment reply-to form output in the Comments list table.
Description
Returning a non-empty value here will short-circuit display of the in-line comment-reply form in the Comments list table, echoing the returned value instead.
Parameters (2)
- 0. $var (string) =>
''
- The reply-to form content.
- 1. $array — Optional. (callback) =>
array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode )
- An array of default args.
Usage
- To run the hook, copy the example below.
- $var = apply_filters( 'wp_comment_reply', $var, $array );
- if ( !empty( $var ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_comment_reply callback
- function filter_wp_comment_reply( $var, $array ) {
- // make filter magic happen here...
- return $var;
- };
- // add the filter
- add_filter( 'wp_comment_reply', 'filter_wp_comment_reply', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_comment_reply', 'filter_wp_comment_reply', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/template.php
- $content = apply_filters( 'wp_comment_reply', '', array( 'position' => $position, 'checkbox' => $checkbox, 'mode' => $mode ) );