The
wpum_field_ouput_callback_function
filter passes 3 arguments, the original callback function used for the field, the field object and the value. See here for the source code
Example field output customization:
The filter can be used to use a custom function to modify the output of the field within profiles pages. By default WPUM uses separate functions for each field output.
By using the filter, you can tell WPUM to use another function to print the field output on the profile page. In the following example, I’m modifying the output of the Website field, by checking it’s name.
Other methods can be used to determine the field.
Example:
function wpum_custom_field_output( $func_name, $field, $value ) { if ( $field->get_name() == 'Website' ) { return 'my_custom_function'; } return $func_name; } add_filter( 'wpum_field_ouput_callback_function', 'wpum_custom_field_output', 10, 3 ); function my_custom_function( $field, $value ) { return '<i><a href="'. esc_url( $value ) .'" target="_blank" rel="noopener noreferrer">'. esc_html( $value ) .'</a></i>'; }
Get Started with the Best WordPress Membership Plugin Today
Connect, Manage and Build your Membership Site