Skip to content

Instantly share code, notes, and snippets.

@shakhmehedi
Created January 20, 2017 10:12
Show Gist options
  • Save shakhmehedi/c0b90ec4a740309e45073ee14b166b0d to your computer and use it in GitHub Desktop.
Save shakhmehedi/c0b90ec4a740309e45073ee14b166b0d to your computer and use it in GitHub Desktop.
WordPress cheatsheet

#remove wordpress shortcode from post_content if get the content directly from database

$content = preg_replace("[\[([^\[\]]*)\]]", '', $content);

#Remove htmltags from content

$content = strip_tags($content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment