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
- Add 2 links in between the navigation using the Breadcrumb Navxt plugin hook
- Remove H1 title in admin post edit screen
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Over write plugin templates
- Loading class files via autoload method
- How to find out what blocks are added by a plugin
- Determine plugin name from within plugin_action_links filter
- WordPress plugin installation
- How to prevent action in ajax request, when in admin side?
- Override the core function locate_template
- merging an array to an existing array using add_filter
- How to redirect Old Post URL to new Post and keep Old post Comments?
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Modifying Footnote Plugin for Descriptive Title Attributes
- template_redirect not being called when using ajax
- New Plugin: Post update pushes a copy as a revision
- Getting media library popup in custom plugin admin page
- Create or Update thousands of woocommerce products via PHP
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- send_headers don’t work on wordpress multisite
- jQuery function didn’t work in my plugin
- bulk change of image setting “link to” to “link to: image url “
- publish_post plugin hook doesn’t always pass $post->post_content
- Display a text message if the field is not found and not if found
- What are the benefit in adding hook in the init() hook?
- Reposition Woocommerce Message
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- add_action in functions.php, do_action in plugin?
- Escape when echoed
- How to correctly detect accessing wp-content/uploads?
- The Point of Using apply_filters()
- Plugin exceeds memory limit
- How to get post URL in the_content filter?
- Add a plugin before main container
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- How to get variables from fucntion.php to my plugin files
- How to initialize something in unit test before the init hook being called?
- How to include code into functions.php file via a plugin
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- add action for displaying posts using a shortcode
- Missing argument 3 for wp_register_sidebar_widget()
- Write to / remove from default .htaccess file from plugin?
- ‘wp_login’ action hook not working with wp-login.php file
- Update Option Error: Notice: Undefined index
- How to add class in plugin only for network site?
- Plugin Development sqlite or WordPress’ database
- Pass info from functions.php to plugin
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- Remove rewrite rules generated by plugin during deactivation