Don’t mess around with changing those files directly. It will break when that file gets changed in an update. Do this instead.
add_filter( 'wp_mail_from', 'override_mail_from_address' );
add_filter( 'wp_mail_from_name', 'override_mail_from_name' );
function override_mail_from_address($email_address) {
$from_array = explode('@', $email_address);
$from_address = $from_array[0];
$from_domain = $from_array[1];
if (strtolower($from_address) == 'wordpress') {
$from_address = "myname"; /* Put the email address you want here */
}
return ( $from_address . '@' . $from_domain );
}
function override_mail_from_name($email_name) {
if (strtolower($email_name) == 'wordpress') {
$email_name = "My Name"; /* Put the name you want here */
}
return ( $email_name );
}
Related Posts:
- static variable loop not working in WordPress
- How to register images uploaded via FTP in media library?
- how to get permalink structure with php
- Woocommerce auto cancel On-Hold after X days
- Add custom field to attachments in a specific category
- The values of custom fields are not available functions.php
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- Enqueue less file not working in child theme?
- Show last 5 posts from specific category
- “Maximum function nesting level of ‘100’ reached” after adding a new filter
- How can I loop into two different DIVS without repeating the DIVs
- Removing unnecessary wordpress files
- Displaying Logged-In User Name and avatar in WordPress Menu
- Change links automatically to affiliate links
- Use is_product_category() properly
- Theme Options: If There is No Input, Don’t Display?
- Placing raw HTML inside a WordPress shortcode
- Changing Woocommerce flat rate every nth number of items
- Convert all images to PNG on file upload
- If search results empty then execute certain code
- Way to querry data (tags) from a wordpress database?
- Changing custom logo link
- Using fwrite() and “a” appends multiple times instead of once
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- Add a variable in functions.php and call it in single.php
- How to display posts by current user in a drop down
- How does WordPress insert Paragraphs in posts
- Linking text within textarea of custom meta box
- How do I add custom bulk actions to multiple custom post types?
- Making BuddyPress Activity Stream (Post Type) Featured Images Clickable [closed]
- what is the best practice to add new field to an api route
- Keyword checking in Gravity Forms
- how to refresh div on template part?
- Child page menu in sidebar
- Title Case WordPress Menu Items
- How to list posts from a plugin taxonomy?
- Filtering a function’ output for a new continued function
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Theme not calling Jquery properly
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- WordPress redirect redirecting too many times or not at all
- How to make jquery count down timer function manually editable
- Hierarchical taxonomy list with modificated term links
- Add value to new attribute inside WordPress menu items
- Please show me how to use an if/else statement in combination with wp_enqueue
- If Array Values Match Another Array’s Values, Then
- entire JS folder not loading in a WP theme
- Open and closed function [closed]
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Else/If Statement to Display Photo Descriptions
- Count foreach and display in menu php
- Strip from or something better?
- Display additional page templates and a sidebar on plugin activation
- Remove role of user after X days
- User filter posts by year
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- Adding wp users ID into a link address from a DIVI modul
- Execute function only for specific user roles
- how to replace h1 entry title with h2 in category pages only
- How to unset a function from a action inside a class, that is called in another class
- Create a new account on site B with data from the purchase of site A
- Why is the current page loaded in the pop-up window and not the specified one?
- if get_post_meta is empty echo a placeholder or shortcode
- Connecting to upstream failed
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- WP query posts BUT show the most recent and one per author
- Block error message in foreach loop when looping through ACF field
- Include User ID in iFrame URL
- PHP multiple forms, same page, isset($_POST[]) not working?
- Outputting post content to jQuery .html() string
- shortcodes, custom php and their errors
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- post_exists stops working in a scheduled event
- Where do I implement this display of User Meta Data, and how to put it in a table?
- Remove node from multisites?
- Add ID to output only for first option
- How to add custom text near category/tag title in WordPress Twenty Fifteen Theme?
- Issue encountered while trying to keep website private
- Display text of price (minus 20%) on every product page in a sentence.
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- How to make 2 similar functions more efficient
- Echo multiple tasks if a common function exists
- wp_delete_comment is doing nothing
- Add end mark at the end of every article
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Custom meta box save values issues – Deprecated: Function ereg() and more
- Ninja Forms – pull in some post related information
- Functions are causing errors
- Global variables and re-use
- Issues separating my Plugin pages into different files
- Link to external page has wordpress blog-url inside
- AJAX: WordPress filters inside $html do not work as intended
- Appending an ACF custom field to the page title
- Show div only if product has attribute
- In WordPress how do you remove render-blocking CSS manually without a plugin?