Forked from eduardozulian/wp-unprotected-meta.php
Last active
February 21, 2024 11:18
-
-
Save ntamvl/9fcd8294cf8a5cee935a to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Replace the default "_" (underscore) with "-" (hyphen) in protected custom fields for debugging purposes | |
* | |
* @param bool $protected The default value | |
* @param string $meta_key The meta key | |
* @return bool True for meta keys starting with "-" (hyphen), false otherwise | |
*/ | |
function unprotected_meta( $protected, $meta_key ) { | |
$protected = ( '-' == $meta_key[0] ); | |
return $protected; | |
} | |
add_filter( 'is_protected_meta', 'unprotected_meta', 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment