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
- Sanitize and data validation with apply_filters() function
- How many filter/action hooks are healthy?
- Filter specific shortcode output?
- Insert new element to array with add_filter
- How to hook into unregistering a widget instance?
- How can I extend the Gutenberg table block transform to allow colspans/rowspans on pasted table elements?
- How do I use the ‘http_request_host_is_external’ filter
- get_option() filtering and getting out of recursion
- Get excerpt from $post->post_content
- How can I add information underneath the user’s name on the users.php page?
- AJAX filter posts on click based on category
- How can I filter Microsoft Word gunk from pasted content?
- How do I know if author field was changed on post save?
- Allow Profile HTML for select users
- WordPress 3.5+ upload tool filter
- Search with filters and title
- Use content custom filter for all shortcodes
- Filter all html output
- Which hook is fired when inserting media into a post
- How to specify which category of the post to use in case of multiple categories
- Return array of images after content
- failed to filter hook `get_terms_defaults`
- Filter list by a unique meta value dilemma
- How to use shortcode attribute in separate function
- return values from hooks do_action and apply_filters, which is better
- Is it possible to track down Actions and Filters?
- get_title without filter(the_title)
- How can filters be run when they are never applied?
- How to filter a wordpress core function?
- Adding id and class to the search input in WordPress search form
- get_bookmarks filter not supplying query argument (wp 3.1)
- Filter Posts by current Month
- Is there a filter called ‘network_admin_init’?
- Manipulating show_on_front, page_on_front, page_for_posts and template hierarchy
- Post Content, Special Characters and Filters
- Correct method of redirecting user login
- How to filter for user registration, be able to throw error message
- Admin filter for product SKU?
- Contact Form 7: Make field required after checkbox is checked
- Customize title, description and focused keyword [closed]
- Filtering the post list in the admin area
- Filter pre_get_posts does not modify Mine/All/Pending
- How to check if a protected hook is hooked?
- Can i use multiple ‘the_content’ filters?
- term_link filter gives less atributes
- Add mime types with plugin
- Filter media upload attachment meta
- Filter have_posts()/ the_post()
- Filter wp_redirect() to stop redirect under certain condition
- Echo string in admin panel footer beside version no
- How to change default text for specific post type
- Add PHP code after title in single post pages?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- How To Get Search Term and Use in Function
- Hook in a sidebar widget and add some markup
- preg_match() not working with post content
- return get_the_tag_list with whitespace removed
- ‘manage_users_custom_column’ is a filter, but ‘manage_posts_custom_column’ is an action. Why?
- Line Breaks are stripped off when direction property is found
- Modify author url display in edit-comments.php
- Need to suspend RSS feed while repairing missing old post
- WordPress remove_filter not working
- How to exclude or include categories in wp rest API without query parameters?
- Filter Post Title without affecting screen-reader-text
- Hook to change the site URL
- Replace a specific URL on all apperances on the Website (Maybe a filter?)
- Strange behaviour of REGEX in a WordPress filter (trying to suppress emtpy paragraphs)
- Modify Contextual Help
- Widget image reorganize layout
- WordPress set featured image to first image of the post
- Modify WordPress search behaviour in backend?
- Modify category listing API response
- Auto-generated excerpt with shortcode and read more button/text link
- Converting restricted html in comments to bbcode
- What is the proper/best way to have multiple add_filter for wp-job-manager-resume
- Modify WooCommerce email shipping text value
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- How to replace all images in all posts and pages with a different size?
- Using Filters To Change Page Title
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- using posts_where for meta data on pre_get_posts
- can’t output gray scaled image I’ve created using add_image_size
- How properly write function to filter content in a template for plugin “multiple content blocks”
- ACF Load Field Groups Programmatically [closed]
- Limit total tags in the_content