Source View: comment_form_default_fields

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2206      $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
2207
2208      /**
2209       * Filters the default comment form fields.
2210       *
2211       * @since 3.0.0
2212       *
2213       * @param array $fields The default comment fields.
2214       */
2215      $fields = apply_filters( 'comment_form_default_fields', $fields );
2216      $defaults = array(
2217           'fields'               => $fields,
2218           'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
2219           /** This filter is documented in wp-includes/link-template.php */
2220           'must_log_in'          => '<p class="must-log-in">' . sprintf(
2221                                         /* translators: %s: login URL */
2222                                         __( 'You must be <a href="%s">logged in</a> to post a comment.' ),
2223                                         wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )
2224                                     ) . '</p>',