Skip to content

Instantly share code, notes, and snippets.

@tribulant
Created November 27, 2014 10:24
Show Gist options
  • Save tribulant/6be645c82fea82c4a9bc to your computer and use it in GitHub Desktop.
Save tribulant/6be645c82fea82c4a9bc to your computer and use it in GitHub Desktop.
<?php
add_filter('newsletters_theme_before_wpmlcontent_replace', 'replace_wpmlcontent', 10, 1);
function replace_wpmlcontent($body = null) {
//let's see if this is a post/page editing screen
//if it is, we'll replace the [wpmlcontent] code in the newsletter theme with nothing
if (preg_match("/(post\.php|post\-new\.php)/", $_SERVER['REQUEST_URI'], $matches)) {
return preg_replace("/\[wpmlcontent\]/si", "", $body);
}
return $body;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment