comment_form_default_fields
Filters the default comment form fields.
Description
Parameters (1)
- 0. $fields (array)
- The default comment fields.
Usage
- To run the hook, copy the example below.
- $fields = apply_filters( 'comment_form_default_fields', $fields );
- if ( !empty( $fields ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the comment_form_default_fields callback
- function filter_comment_form_default_fields( $fields ) {
- // make filter magic happen here...
- return $fields;
- };
- // add the filter
- add_filter( 'comment_form_default_fields', 'filter_comment_form_default_fields', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'comment_form_default_fields', 'filter_comment_form_default_fields', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/comment-template.php
- $fields = apply_filters( 'comment_form_default_fields', $fields );