Because the $current_user
object doesn’t have a property called user_nickName
because the user nickname is stored in the user meta.
$user = wp_get_current_user();
$meta = get_user_meta( $user->ID );
$nickname = $meta->nickname;
Or
$nickname = get_user_meta( wp_get_current_user()->ID, 'nickname', true );
Related Posts:
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Why do templates contain so many PHP tag pairs?
- Displaying Logged-In User Name in WordPress Menu
- What exactly does “Posts page” do in WordPress?
- Check if a menu is empty?
- Static Frontpage Pagination – Custom loop
- WordPress Template Engine?
- How to have a custom display for both woocommerce archive and product-category pages? [closed]
- On this day PHP code
- Blank on static home page?
- WordPress theme & site not loading after moving files
- Adjust the results quantity for Search Results page pagination
- Is it possible to use the featured image of a page as a css background without inlining?
- Link to file in plugin directory from wordpress template?
- Password protecting content in custom template
- How to override wp-admin styling
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Custom field value not saving when it contains a URL?
- Create a new usermeta field for users
- How to get a list of all possible values of a specific user meta key?
- How do I display a user’s previous orders as a select box option on a product?
- Render ninja form inside markup
- How to use an associative array in post__in with WP_Query?
- Mass update excerpt
- How can I get a single php file that is the equivalent of an existing WordPress page?
- function to assign user role based on a field from usermeta
- Custom search results page not working with empty search
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- Creating user status mode in WordPress
- How can I save unique user data on my site? [closed]
- Adding number to date not working [closed]
- Change title only in dynamic page
- Enable custom logo upload if logo is not in header
- php function to display commenter username or login
- How can I edit the content in index.php? [duplicate]
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- a:0:{} is replaced into database as s:6:”a:0:{}”;
- PHP include is only working in certain places in my custom WP theme
- Use WordPress function in php file
- Add filter multiple times using only one master function
- php if username is role
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Removing WordPress Footer -without access to PHP code?
- How to set a template with wp_insert_post
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- How to update and save user metadata on page visits?
- Create page template via functions.php?
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- If Array Values Match Another Array’s Values, Then
- how to display this functions?
- is_page_template showing partial results
- Adding regular php file to site
- Shortcode for Listing Users from Meta Value?
- Getting different user data depending on where I use variable
- Post repeated when opening in overlay, how do I solve this? [closed]
- How to suppress template-parts in undescores?
- Comapare get_user_meta value
- How can get all users by current user meta?
- Creating custom page template from existing PHP site
- Conditional string comparison failing for basename/slug
- php return username of currently viewed author profile
- pass html code to worpdress
- Getting a WordPress tag to print inside of a traditional php echo
- Prevent header and footer from loading on specific pages with template or plugin
- Display metabox galleries on specific page template in admin editor
- Display WordPress archive template page in 3 columns and not 1 column [closed]
- Run do_shortcode on php template using JS function
- User meta needed in query is serialized – how to unserialize safely?
- Include User ID in iFrame URL
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- How to hardcode header and footer in WP?
- Display a custom name when the user has no name settle in his account
- Polylang and template files
- Store data from JavaScript object to custom table in user account
- Redirect user to a custom url after logged in
- How to change the value of a variable using input field?
- Where do I implement this display of User Meta Data, and how to put it in a table?
- How to create dynamic templates?
- If is_page elseif is_page not working like I want it to
- Change WooCommerce template for PDF – access to custom field
- Update an additional user meta field with a string
- missing admin bar and widget in a template
- How to include a function in a template with template tag
- Right way to display the_author_meta fields?
- Adding user meta to post meta wp_insert_post() not working
- My own theme’s custom widget areas are not working
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Updating meta_value in a custom key
- Limit the number of successful logins
- How to call a certain object/menubar in a PHP file
- Get author meta of all writers
- Let users register weight each day and save it in DB
- why is markup routinely placed in functions in wordpress?
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- A better way to write this php function
- How can one use variables in a template or template part without polluting the global scope?