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?
- 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?
- 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
- 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
- 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
- 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
- Must filter functions receive all arguments passed to them?
- Only load certain artists on this page
- User filter posts by year
- comment_post (if comment is approved OR $comment_approved === 1) not working?
- Show all people who commented on all posts by an author
- Apply function.php filter only if url not has /amp/
- How to bind each “the_content” elements to a custom variables
- Reload page with a different shortcode when a user selects from a dropdown
- WordPress Ajax filter: Create two loops for different output styles?
- How to filter specific element of an array in wordpress/php?
- Custom Bulk Actions handler not firing
- Store custom field’s multiple values in one user meta key
- How to generate customized filtered output for the gallery
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Display posts using post ID’s in an 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
- 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?
- How to pass value to add_filter wpcf7_form_tag from another function?
- Is there a hook that I can use when a fatal error occurs?