Skip to content

Instantly share code, notes, and snippets.

@ultimatemember
Last active August 29, 2015 14:15
Show Gist options
  • Save ultimatemember/cebf7407ea1c93dea904 to your computer and use it in GitHub Desktop.
Save ultimatemember/cebf7407ea1c93dea904 to your computer and use it in GitHub Desktop.
Control the output of a textfield using UM filter hooks
/*
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;
}
@jccardenas5
Copy link

Any chance the same could be done for a Dropdown field? Like filtering the shown values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment