Created
August 29, 2020 18:34
-
-
Save qstudio/b85a935be8d255ad4529520ca5da116f 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
// admin display key ## | |
\add_filter( 'q/eud/admin/display_key', [ get_class(), 'display_key' ], 10, 1 ); | |
/** | |
* Filter keys in EUD plugin | |
* | |
* @since 2.0.0 | |
*/ | |
public static function display_key( $string = null ) | |
{ | |
#helper::log( 'string from filter: '.$string ); | |
if ( is_null( $string ) ) { | |
return false; | |
} | |
// array of translations ## | |
$array = [ | |
'example_usermeta_key' => 'Cleaner Title', | |
]; | |
// check if $string exists as key in $array and if so, replace and return ## | |
if ( array_key_exists( $string, $array ) ) { | |
return $array[$string]; | |
} | |
// kick it back ## | |
return $string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment