Its looks like you are trying to set a header propery which already been used to create header.
So what I would suggest is set the property and then call the createHeader()
function so now again when building header your changed property should work.
You don’t have to use filter
you can use the action
hook itself as the action is refernce
to the gobal phpmailer
Example
add_action( 'phpmailer_init', 'update_priority_mailer' );
function update_priority_mailer( $phpmailer ) {
$phpmailer->Priority = 5; //can be 1, 3, 5
//now again construct the header so the change property will be used
$phpmailer->createHeader();
// since $phpmailer is an reference variable everything will be updated
}
You can also check other methods addCustomHeader()
Related Posts:
- How does one suppress a 404 status code in a WordPress page?
- Admin bar and fixed header issue?
- How to remove rest api link: in http headers?
- disable wordpress canonical tag meta
- Disable h1 and h2 from rich text editor combobox
- Recommended location to set response headers?
- Is it safe to fix Access-Control-Allow-Origin (CORS origin) errors with a php header directive?
- Custom endpoint and X-WP-TotalPages (headers)
- Getting “Cannot modify header information – headers already sent” error on wp-admin only whenever any plugin is activated
- Additional Option on Custom Header admin
- How can I use CURLOPT_USERPWD in wp_remote_post?
- Setting Last Modified HTTP Header on static Home Page
- If Modified Since HTTP Header
- Getting redirect to happen before header output
- How do you log a user out with wp_logout?
- Change the headers content type with wp_remote_post
- Why I can’t add a script-code into theme-settings without 403-forbidden?
- HTTP Header on specific page is application instead of text
- Is it wrong to put header tags inside WordPress help tabs? [closed]
- Authenticate a user for current request
- Remove link around logo
- Want to make header and footer CMS driven sothat Editors can modify its content from wordpress admin section
- Facebook embeds loading the wrong language
- Header: Include Date Published and Date Modified
- Page source contains an http item that makes page insecure; but in php files it’s written as https!
- Cleanup Body_Class
- Banner in WordPress
- I want to hide header in the static homepage that I am working on [closed]
- Remove all WordPress HTTP headers (not in-source embeds)
- Creating dynamic header and footer files
- My header not showing up [closed]
- How to Access Script Tags in Header
- H1 tags for header image?
- Problems accessing stylesheets/scripts loaded in WP header
- Rotate images in header based on date
- Trying to set a cookie based on $_POST parameter
- How to add some lines to the wp-login.php header via functions.php?
- How to Customize Wp Default Title and a prefix
- allowed_http_origins() only works in theme functions.php
- Insert stylesheet into WordPress header?
- How to register and set http/2 server prefetch for a specific asset?
- Header with content
- WordPress Template not getting my Sub-Header File
- How to add social follow button to header? [closed]
- Include two headers
- What is this HTTP_REFERRER “WordPress/4.1.2”
- Empty lines in header, how to remove them
- Benefits to using CSS for header image instead of html img tag [closed]
- Export Header and Footer
- Custom headers in WordPress, are there also custom footers?
- Point get_header() to different plugin
- Inserting iframe right after on header.php
- How to add script right after ?
- Code needs wrapper/container to put footer back in, but where?
- How can I remove or change the tooltip of an icon
- Design Header meta on single posts wordpress
- Including PHP files in header.php
- Using a nonce Content Security Policy header for style-src for inline style elements returns errors
- How can I use an iframe element as my header media?
- How to make my banner (logo image) position on the center
- Easiest way to use relative URLs in my WordPress header
- Should I use do_action in the header file?
- Update Code to be Compatible with WP 5.3 (‘cannot modify header information’ warning)
- set cookies on certain page only
- Twenty seventeen header is not responsive
- 3 WP installations on the same domain, with the same header
- How to make custom_header_setup() image as background image?
- Video Header in 2016 theme
- WordPress cookie issue on login: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- my dashboard does not have the option to fix the header or change the theme. how can i get that to show?
- Insert Code into Header Only on Blog Posts
- How do I change top header background color
- Why is http header providing 404 while site is online?
- only header is showing up in posts
- In the Header.php file, is there a way to swap between one layout and another?
- force download a file in template_redirect hook
- video header in desktop view, image header in mobile view
- expires header in w3 total cache
- Force download of MP3 file in Safari
- show wordpress data without headers
- Override theme metadata in header
- Header Image instead of dynamic text
- Code to Show for One post only in head
- Checking if certain header meta data is set
- setCookie before headers are sent?
- Download custom file in wordpress backend [duplicate]
- Removing old code from header
- Random header image but also specific header for certain pages
- How to remove uncategorised posts from WordPress
- Dynamically changing header text depending on URL in WordPress html page
- After being hacked Fatal error: Call to undefined function get_header() in 404.php on line 1
- change headline of page
- making posts linked outside of WordPress still use the same header and footer
- How change the header color?
- How to remove lines over text using Phlox theme with Elementor Pro?
- Loading second header.php for other homepage showing double header.
- My CSS, footer and header don’t show up!
- End of script output before headers – multiple apache error_log errors
- WordPress custom header parameter combine with cache
- How do you modify HTTP response headers on feed/?