If I understand you correctly you want to change the subject line of the email. The hook of your code only changes the content of the e-mail. There’s a different hook for the subject:
add_filter('comment_notification_subject', 'wpse_228315_comment_notification_subject');
function wpse_228315_comment_notification_subject($subject, $comment_id){
return "New comment";
}
Related Posts:
- WP showing “warning: call_user_func_array()”, What to do?
- How to Loop Plugin Option Field Set?
- Saving Plugin settings to the database
- Fatal error: Class not found in
- HELP: Integrating WP with raw PHP code once published button is hit
- I would like to use create a function in my custom plugin to tell WP to use a different header
- Placement of Code in Plugin for hooking `save_post`
- Scope for PHP Variables Assigned in functions.php or a plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- wordpress plugin is not activating from widget
- Edit Yoast SEO breadcrumbs output [closed]
- Using a post-signup hook to get user details
- Conditional attributes and logic per product category
- WordPress get_avatar function not correct working
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- execute function after one completed
- Are there action hooks for comments?
- How do I add $_SESSION[”] to my wordpress page?
- Plugin onclick button activate other plugin
- Save user total active time after login in wordpress [closed]
- Different registration form for different roles
- More gentle way to hook WordPress custom url
- How to add custom function to pluggable.php
- Checkbox show / hide output result
- WordPress Custom Hook with Class method
- Allow a particular user to access a particular plugin?
- Cookie value changes back to previous value after changing
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- The function called on the wp head hook becomes null
- adding dynamic/multiple slug values in ‘option_none_value’
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- working code, not working – Plugin Dev
- Is admin section completely customizable in terms of styling?
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- plugin not hooking to my custom hook
- Populate select option with JSON file
- Plugin Hook: Get posts
- Saving an array to get_options
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- How use Dynamic hyperlink on each wordpress post?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Mixed results with is_page() WordPress function, when using $this, or self
- Read page- or post-content across different builder-plugins
- Remove H1 title in admin post edit screen
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- Plugin update error message
- Using the ‘draft_to_publish’ hook (post status transition)
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Rename existing old uploaded images containing accented French characters (not during upload)
- How to Create a Directory in a Plugin Folder?
- Failed to invoke other hook from the init hook
- Create plugin that works in background
- Checking for user role in a custom plugin
- Extend Elementor Archive Posts widget with a custom skin in order to show multiple badges
- Loading class files via autoload method
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Modifying Footnote Plugin for Descriptive Title Attributes
- Getting media library popup in custom plugin admin page
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- Escape when echoed
- How to get variables from fucntion.php to my plugin files
- ‘wp_login’ action hook not working with wp-login.php file
- Redirecting to home page after login as custom role WordPress
- Where (or when) should I register a new taxonomy?
- How to stop or remove an action being called inside a function of an extended class
- Date calculations from 2 custom fields
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- How to enable specific plugin only based around shop manager role?
- Adding a new field to the address field type in gravity forms
- Nested shortcode functions accessing variable
- Which file of wordpress manage plugins functionalities?
- JQuery prepend a function
- Send email with list of active plugins upon activation/deactivation
- How WordPress core manage the plugin installation
- Add action to custom Function
- How to create admin setting for this small plugin
- Alternative Hook to the_content for Changing Background Color
- Unpublished Pages Failing To Appear On Custom Path
- Post source link plugin – small modification
- Hooking into the HTML header container
- Block plugin update possibilities (but not by hiding notifications)
- Soflyy WP All Import Custom File Download Issue
- WordPress Admin sub-level menu issue
- Displaying friend’s posts only
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Contact Form 7: custom validation [closed]
- What can I do to customize a widget provided with this plugin? from where have I to start?
- PHP if url extension action=discussion condition use [closed]
- How to Add Extra Text In WordPress Title Before Post Publish
- Function not being called on form submit, only blank admin-post.php page
- WordPress Convert queries to slashes using function.php