learndash_usermeta_shortcode_field_value_display

apply_filters( 'learndash_usermeta_shortcode_field_value_display',  string $value,  array $attributes,  array $usermeta_available_fields )

Filters usermeta shortcode field attribute value.


Description #


Parameters #

$value

(string) Usermeta field attribute value.

$attributes

(array) An array of shortocode attributes.

$usermeta_available_fields

(array) An array of available user meta fields.


Source #

File: includes/shortcodes/ld_usermeta.php


Examples #

 <?php
/**
 * Example usage for learndash_usermeta_shortcode_field_value_display filter.
 */
add_filter(
	'learndash_usermeta_shortcode_field_value_display',
	function( $value, $attr = array(), $usermeta_available_fields = array() ) {

		if ( ( isset( $attr['field'] ) ) && ( $attr['field'] == 'my_custom_usermeta_field' ) ) {
			// Set the $value to something here. This can be any HTML value.
			$value = 'This is the display of my custom field';
		}

		// Always return $value
		return $value;

	},
	10,
	3
);
 

Changelog #

Changelog
Version Description
2.4.0 Introduced.