Let me try this again,
I’m trying to add an affiliate pixel tracking code to the body of a confirmation page and WP keeps changing the & into (& #038 😉 (without spaces)
For example:
The code should show AMT=9.99&UID=99999 but WP keeps changing it to AMT=9.99& #038 ;UID=99999
What can I do to have WP display & instead of (& #038 😉 (without spaces) or (& amp 😉 (without spaces)
I’m using WP 4.4.2
So far, the code keeps switching to (& #038 😉 (without spaces)
I’ll be a little more specific.
I need the code to read
<img src="https://track.example.com/tracker.aspx?AID=1111111-111-11&AMT=9.99&UID=123456789" alt="" width="1" height="1"/>
WordPress keeps changing it to:
<img src="https://track.example.com/tracker.aspx?AID=1111111-111-11&AMT=9.99&UID=123456789" alt="" width="1" height="1"/>
Second line should read:
<img src=”https://track.example.com/tracker.aspx?AID=1111111-111-11& ;AMT=9.99& ;UID=123456789″ alt=”” width=”1″ height=”1″/>
For those still interested I fixed the issue by editing the formatting.php file
Added the following code to lines 1620-1624
function so_handle_038($content) {
$content = str_replace(array(“&”,”&”), “&”, $content);
return $content;
}
add_filter(‘the_content’, ‘so_handle_038’, 199, 1);
—AND—
Comment out line 238
$curl = preg_replace( ‘/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i’, ‘&’, $curl );
Comment out line 285
$curl = preg_replace( ‘/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i’, ‘&’, $curl );
Comment out line 3400
$url = str_replace( ‘&’, ‘&’, $url );