Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use register_meta to sanitze your meta values
<?php
register_meta( 'post', 'mein_metakey', 'mein_metakey_sanitize_callback' );
function mein_metakey_sanitize_callback( $value, $key, $type ){
if ( 'post' === $type && 'mein_metakey' === $key )
return (int) $value;
return $value;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment