Last active
August 29, 2015 14:15
-
-
Save ultimatemember/cebf7407ea1c93dea904 to your computer and use it in GitHub Desktop.
Control the output of a textfield using UM filter hooks
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
/* | |
This is a sample filter that assumes your textfield meta key is "buttoncode" | |
The filter below allow you to change the output dynamically | |
to show a shortcode instead of the value entered for that field | |
Use in theme functions.php and do not have to rely on UM core | |
*/ | |
add_filter('um_profile_field_filter_hook__buttoncode', 'um_profile_field_filter_hook__buttoncode', 99, 2); | |
function um_profile_field_filter_hook__buttoncode( $value, $data ) { | |
$value = do_shortcode( $value ); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any chance the same could be done for a Dropdown field? Like filtering the shown values?