What you need to use is comment_form_defaults
filter that has large and nested $defaults
array passed. That array will have (among other things) something like this in it:
fields
author << this will have something like <span class="required">*</span> in it
email << this will have something like <span class="required">*</span> in it
url
comment_notes_before << this will have something like Required fields are marked<span class="required">*</span> in it
So in your filter you need to change these fields in array you got passed and return whole array.
Related Posts:
- Change comments form title on a page by page basis
- Filtering a function’ output for a new continued function
- Warning: in_array() null given in PHP function
- Display a post based on its metabox selection
- How to make a image-size selected by default in Media upload – WP v3.5
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- static variable loop not working in WordPress
- adding a filter to a shortcode?
- Set media upload attachment link to none and hide it in WP v3.5
- How to store the_title() into a variable to reutrn the value, not just echo it
- Change the footer text on the login page
- add_filter to post-gallery and remove all ‘s?
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Check if page parent has certain template
- Remove class that has been added by parent theme
- How do I create comment-reply-button using element not
- How do I know what variables are passed in a filter/action and what their meaning is?
- Need to get specific data from array
- Why do filters/actions require an argument count?
- Create an array from an array
- Replace comment avatars and links at the same time
- Check if term object is in array
- Adding ads code between comments
- How to use return in my custom function instead of echo
- How do I fetch all comments per post via WP REST API?
- Run a filter when a walker runs
- comments_number display outside specified span
- Handling Body class based on Template
- Get_avatar filter?
- Add a class to the anchor tag on HTML5 gallery
- How to properly loop through these external URLs to get them into the sitemap using this hook
- add_action shortcut?
- get a simple array of all of the term names that exist in all taxonomies
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- How to control WordPress image metadata (using Imagick)?
- How do I add custom bulk actions to multiple custom post types?
- Add data attribute to each li in menu
- Why does my callback function not work with this custom filter hook?
- Removing “wpautop” (auto tags) only on certain pages?
- Print last modified date only on posts
- WordPress Gravatar filter is removing my custom attributes
- foreach loop still echoes array
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Ajax load more button for comments wordpress
- Unique icons next to each WordPress menu item
- Limit 1 global comment per minute
- Create Page To Count Comments For Each Post In WordPress Site
- Checking array against author id in loop
- wp-comments-post.php file returns a blank page
- php function to display commenter username or login
- Redirect to another page using contact form 7? [closed]
- Add item to top of menu using a filter in functions.php
- meaning of (array)function()
- How to make modifications only to certain elements of an HTML string on the server-side?
- Override a function defined in wp-includes/comment-template.php
- wp_force_remove_style’ not found
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Deleting Certain terms from appearing on the front end as links
- Content filter won’t work
- How to use array in function to get only value I want
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- Add meta tags to a custom header
- Send a mail to specific address in a custom field when a new comment is made on a specific post
- Loop over Array and get the distinct ids
- If Array Values Match Another Array’s Values, Then
- How to have different site identity logos on each page on Astra Theme [closed]
- Custom query vars filters problem with pagination
- Filter by field with array value in ACF on WP REST API
- Fetching Initials of the Commentator in the WordPress Website
- Get the name of menu item with wp_nav_menu
- How to add aria role and schema markup to custom walker container
- Dynamically adding filters
- str_replace not preserving whitespace
- Add custom filter to register data in array
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Woocommerce Price Text
- Limit Taxonomy Parents
- Search box background on a different page template
- Display a list of users with avatar filterable with alphabets
- Showing all post from all post type in admin backstage
- How to get the rating value of each comment
- Trouble figuring out how to get my button to submit comment
- AJAX: WordPress filters inside $html do not work as intended
- Assign new post author IF another user in custom field on post transition
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- How to add different menu items on different menus?
- Replace block content with an array
- How to pass value to add_filter wpcf7_form_tag from another function?
- Add text below WooCommerce short description if metabox value is true
- Is there a hook that I can use when a fatal error occurs?
- Unable to logout correctly after wp-login file was modified
- Adding Author Filter to CPTs
- How can I display formatted content using the_content filter?
- Get check box values inside array for use in posting form data
- Removing website URL in comments causes misalignment of submit button and tickbox