Skip to content

Instantly share code, notes, and snippets.

@man4toman
Last active October 4, 2018 11:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save man4toman/60fb15718112194f7be03f0589012871 to your computer and use it in GitHub Desktop.
Sanitizing Arrays in WordPress
<?php
function wp_sanitize_array( $input ) {
return array_map( function( $val ) {
return sanitize_text_field( $val );
}, $input );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment