Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created October 11, 2018 02:28
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommcfarlin/77f82db963da726646307a8459dc2500 to your computer and use it in GitHub Desktop.
Save tommcfarlin/77f82db963da726646307a8459dc2500 to your computer and use it in GitHub Desktop.
[WordPress] Quick Tip: Sanitize Post Data in WordPress
<?php
public function sanitize(string $data): string
{
return strip_tags(
stripslashes(
sanitize_text_field(
filter_input(INPUT_POST, $data)
)
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment