Snippet Shortcodes
  • Welcome
  • Getting Started
    • Page
    • Quickstart
    • What is the Premium Plugin?
    • Creating your first shortcode
  • Features
    • Overview
      • Auto-insert into Header / Footer
      • Limit to Device Types
    • Your own Shortcodes
    • Ready-made Shortcodes
      • Premium
        • Database values by ID
        • WooCommerce Meta Fields
        • WordPress User fields
      • Core
    • CSV Import
  • Further Info
    • Pricing & getting a license
  • Release notes
  • Contact / Issues
  • Download Links
    • Core plugin
  • Premium Plugin
Powered by GitBook
On this page
Edit on GitHub
  1. Features
  2. Ready-made Shortcodes
  3. Premium

WordPress User fields

PreviousWooCommerce Meta FieldsNextCore

Last updated 5 days ago

Fetch and display a WordPress user meta field for the user currently logged in. This shortcode, in essence, wraps around the WP PHP function .

Easy-to-use examples

Below are some examples of default WordPress user meta fields. However, plugins often add their own (e.g. ) this shortcode will allow you to fetch their fields too.

[sv slug="user-meta" field="user_login"]
[sv slug="user-meta" field="first_name"]
[sv slug="user-meta" field="last_name"]
[sv slug="user-meta" field="nickname"]
[sv slug="user-meta" field="email"]
[sv slug="user-meta" field="user_url"]
[sv slug="user-meta" field="description"]

Shortcode Arguments

The shortcode supports the following arguments:

Argument
Description
Options
Example

field

User meta field to display e.g. last_name

text

[sv slug="user-meta" field="last_name"]

message-not-found

Message to display if field is empty

Text

[sv slug="user-meta" field="last_name" message-not-found="Last name is missing"]

get_user_meta()
[WooCommerce]