Created
August 15, 2014 17:31
-
-
Save bfillmer/bfd60e9b14d0c8dd32bb to your computer and use it in GitHub Desktop.
Quick way to hide protected meta data via a plugin. More robust than the _ prefix.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'is_protected_meta', 'hide_meta_data', 10, 2 ); | |
/** | |
* Set our metadata to be protected, will not be seen in administration, | |
* unless the plugin is deactivated. | |
* @param array $protected protected values | |
* @param string $meta_key current meta key | |
* @return string/bool $protected or true to add | |
*/ | |
function hide_meta_data( $protected, $meta_key ) { | |
if( 'shipping-preference' == $meta_key ) return true; | |
return $protected; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment