Skip to content

Instantly share code, notes, and snippets.

@man4toman
Last active October 4, 2018 11:39
Show Gist options
  • Save man4toman/60fb15718112194f7be03f0589012871 to your computer and use it in GitHub Desktop.
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