Last active
August 29, 2020 18:31
-
-
Save qstudio/cf49314e5cb4521b86cca72ae51c992d 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
// Add the filter ## | |
\add_filter( 'q/eud/export/field', [ get_class(), 'field_key' ], 10, 1 ); | |
/** | |
* Filter keys in EUD plugin | |
* | |
* @since 2.0.0 | |
*/ | |
public static function field_key( $string = null ) | |
{ | |
#error_log( 'string from EUD filter: '.$string ); | |
if ( is_null( $string ) ) { | |
return false; | |
} | |
// rename specific fields ## | |
switch( $string ) { | |
// usermeta field key ## | |
case 'example_usermeta_key' : | |
// string replacement to show in export ## | |
$string = 'Cleaner Title' ; | |
break ; | |
} | |
// apply optional format to all strings ## | |
$string = str_replace( "_", " ", ucwords( $string ) ); | |
// kick it back ## | |
return $string; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment