For the arguments, check the source:
$notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment_id );
You have two parameters. The first is the notification text itself, prior modification by your filter. It is constructed earlier in the same function and is different for comments, trackbacks, and pingbacks. The second parameter, as you might guess from the name, is the comment ID. That is all correct, as per the Codex entry you found.
However, your problem is that only the first parameter is passed by default. If you want any of the others you have to ask for them by means of the fourth parameter of add_filter
.
add_filter("comment_notification_text", "x99", 1, 2);
The third parameter is a priority. You can raise that or lower it depending on your needs. 1
should run your filter early.
Related Posts:
- How to add headers to outgoing email?
- Editing ‘Password Reset’ E-mail
- wp_mail – Remove sitename from email subject
- How to disable all WordPress emails modularly and programatically?
- wpmu_signup_user_notification filter not working
- Is it possible to put the add-filter()-hook into a function?
- How can I change the email that is inside the default email texts of wordpress?
- Help with filter for wp_notify_moderator()
- Error using wp_mail inside custom function
- Register new user, assign custom role then send email
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Email Obfuscation: Is antispambot() Acceptable? [closed]
- comment_notification_text filter not working
- Would like to use hook or filters to customize email templates
- Filter wp_mail based on content type
- Disable emojicons introduced with WP 4.2
- How to remove a filter that is an anonymous object?
- WordPress hooks/filters insert before content or after title
- How to add defer=”defer” tag in plugin javascripts?
- add_action(), add_filter() before or after function
- apply_filters(‘the_content’, $content) vs do_shortcode($content)
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- What is the very earliest action hook you can call?
- Disable email notification after change of password
- How would one modify the filtering Gutenberg applies to pasted content?
- How can I modify the WordPress default widget output?
- Add custom options to the wplink dialog
- Remove classes from body_class
- what is __return_false in filters
- Explanation for apply_filters function and its variables
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- Insert HTML just after tag
- the_content and is_main_query
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- How to add a custom CSS class to core blocks in Gutenberg editor?
- How to show page content in feed?
- wp_headers vs send_headers. When to use each?
- Filter any HTTP request URI?
- How to Pass External Variables to Filters/Actions
- How to filter users on admin users page by custom meta field?
- Alert Email when any Post or Page is Changed
- Filter by one custom field, order by another?
- Not able to change wp_title using add_filter
- How to appending to the_content using add_filter with custom post type?
- Query WP REST API v2 by multiple meta keys
- No filter of code on switch from html to visual editor, how?
- Sanitize and data validation with apply_filters() function
- How to modify posts_where filter only for the search query
- How to hook a filter to catch get_post_meta when alternate a custom field output?
- How to get shortcode’s input values inside a filter?
- Removing Image and Caption Dimension Attributes
- How to wrap oEmbed-embedded video in DIV tags inside the_content?
- How to bulk delete all users with no posts?
- How many filter/action hooks are healthy?
- WordPress 3.9 – Trouble Editing TinyMCE 4.0
- Changing JPEG compression depending on image size
- How to add filter with 2 args?
- Why is javascript allowed in my post content?
- How to use update_{$meta_type}_metadata filter to modify meta value
- How to wrap an element around an iframe or embed in content automatically?
- Filter specific shortcode output?
- WordPress Internal @ Mentions
- Earliest hook to reliably get $post/$posts
- Insert new element to array with add_filter
- LESS CSS enqueue_style with add_filter to change rel attribute
- Is it possible to filter comments in a post so a user can only see the comments they have written?
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Remove Editor From Homepage
- How to modify Contact Form 7 Success/Error Response Output [closed]
- Where to hook into post content?
- What does (10, 2) mean when used with add_filter
- Filter translations (gettext strings) on specific admin pages
- Filter username field on registration for profanity and unwanted words
- Clarification on filters and hooks
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- At what priority does add_filter overwrite core functions?
- How to disable the “Your site has updated to WordPress x.y.z” admin email?
- Valid characters for actions, hooks and filters
- How to change the email notification recipient (user) for new comments?
- is it possible to add “extra” table nav to edit-tags.php screens?
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Adding a filter to qTranslate to change display of language chooser
- Insert Custom HTML After Shortcode
- Modify links when inserted by WYSIWYG editor
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- How to hook into unregistering a widget instance?
- How to check if a hook is hooked or not?
- Completely strip any hidden formatting when pasting into TinyMCE
- How can I extend the Gutenberg table block transform to allow colspans/rowspans on pasted table elements?
- How to add filter to __() and _e()?
- Remove description from on Home
- Overriding the default WP Multisite notification e-mail
- Is it possible to use object in add_action?
- add_filter and changing output captions of image gallery
- Customizing the Subject Field in WordPress’ Notification Emails?
- Passing Additional Parameters to add_filter Callable
- Disable new user notification to admin email
- What hook do I use to edit the post statuses option in admin?