Browse: Home / Functions /


learndash_usermeta_shortcode( array $attr = array(),  string $content = '',  string $shortcode_slug = 'usermeta' )

Builds the [usermeta] shortcode output.

Description #

This shortcode takes a parameter named field, which is the name of the user meta data field to be displayed. Example: [usermeta field="display_name"] would display the user’s Display Name.

Parameters #


(array) (Optional) An array of shortcode attributes.

  • 'field'
    (string) The usermeta field to show
  • 'user_id'
    (int) User ID. Default current user ID.

Default value: array()


(string) (Optional) The shortcode content.

Default value: ''


(string) (Optional) The shortcode slug.

Default value: 'usermeta'

Return #

(string) output of shortcode

Source #

File: includes/shortcodes/ld_usermeta.php

Changelog #

Version Description
2.1.0 Introduced.