Wordpress Snippets

Sanitize And Escape Text Input In WordPress

For general sanitization of text input fields and text areas for plugin options and such, use:

sanitize_text_field( string $string )

For escaping in general for text input fields, use:

esc_attr( string $string )

@refer https://wordpress.stackexchange.com/a/66323/90061

Hire Us. Or just say Hi!
Need a job? Apply to get one.