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?
- Enqueue style inside shortcode but its loaded at the bottom of page (before footer scripts)
- Change destination author link
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Is it possible to add an action to the currently running action?
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- Over write plugin templates
- How to prevent action in ajax request, when in admin side?
- Display a text message if the field is not found and not if found
- Reposition Woocommerce Message
- Add a plugin before main container
- Prevent a plugin from being automatically activated
- Any hook for pre-plugin-update -either bulk or single plugin update
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- wp_get_post_terms is difference obj model than the one in rest api response
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Creating a Callback URL for WordPress Woocommerce to update Order Status
- Get Time Taken By Each Action Hook in WordPress
- How to replace WordPress Media Upload Window with user’s device window?
- Setup wp_schedule_event within a custom plugin
- plugins_url() works everywhere but wp_reqister_script()
- Integrating boxtal PHP library into a custom WordPress Plugin
- How to get specific string/value from an array? php [closed]
- WordPress Stock Update Programatically
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Why is it important to check for isset and is_array before checking in_array in this example?
- How to call external functions from a PHP script in a WordPress plugin?
- same user role or copy the user role to be same as the other role
- How can i listing current category and Featured Category post list?
- How to displaying Custom image, text and default image logo from Redux Framework option panel
- save_post_product action not firing
- How to get the custom field value using SQL query
- How use wp_insert_post and add og:custom tags?
- How to change “Read More” text?
- Using id to show item
- Generate and send ICS file through WordPress
- How to make the first letter of a post title uppercase, in a plugin?
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- Migrating custom php we wrote from functions.php into a site-specific plugin
- What is the correct entry point for capturing coverage data
- Creating a user ‘add custom field’ section
- Cannot access variables within a widget
- Display_rows() and column_cb() strange behaviour
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- 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
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database