Skip to content

Instantly share code, notes, and snippets.

@nawawi
Created June 1, 2021 06:21
Show Gist options
  • Select an option

  • Save nawawi/1bd1aa205320edec29369b46401c286f to your computer and use it in GitHub Desktop.

Select an option

Save nawawi/1bd1aa205320edec29369b46401c286f to your computer and use it in GitHub Desktop.
WordPress Comment Website Field required
<?php
add_filter( 'comment_form_defaults', function($defaults) {
$defaults[ 'fields' ][ 'url' ] = '<p class="comment-form-url"><label for="url">Website <span class="required">*</span></label> <input id="url" name="url" type="text" value="" size="30" maxlength="200" required="required" /></p>';\
return $defaults;
}, PHP_INT_MAX);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment