get_current_user_id()
effectively does what @Giri had described in the first snippet. The internal WordPress function-call chain eventually calls get_currentuserinfo()
which already checks if there is a WP_User object, meaning a user is logged in.
Thus, from what I can see in the linked code, get_current_user_id()
always returns the ID of the user that is logged in or zero 0
.
In the current default theme twentytwelve
they are using get_the_author_meta()
to retrieve information about the user, for whom the current author page is displayed. So the difference in WP terminology seems to be “user” for th current, logged in user and “author” for some user, identified by an ID. See: twentytwelve/author.php.
Related Posts:
- Custom user profile, registration, login page with theme
- Why is the reset password key missing in the reset password email?
- How do I create a custom role capability?
- Send user activation email when programmatically creating user
- How to check username/password without signing in the user
- Email verification for new users
- custom XMLRPC method plus authentication of user & WooCommerce order
- How to check WordPress website username and password is correct
- Log in from one wordpress website to another wordpress website
- WordPress REST API call generates nonce twice on every call
- WordPress custom authentication implementation
- How to extend expiry time of jwt wordpress token?
- Configuring WordPress Auth Cookie Expiration
- Get the password key when using the wp_new_user_notification_email filter
- Check if someone is editing a post (this content is currently locked)
- add_filter : Passing an array instead of the callback function?
- Two functions utilizing registration_errors filter
- Buddypress function and global $bp question
- How do I add a prefix when a user registers
- How to add custom fields to the all users page
- SMS registration and login [closed]
- Including the necessary functions for a custom ajax registration form
- user_register not triggering with email verification
- Activate User in Code (BuddyPress+bbpress)
- How to restrict access to image folder depending on whether product is purchased or not?
- Email verification for new users
- How do I add a text field under the activity texarea? [closed]
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- How can I create a custom plugin that allows anonymous users to signup without registering?
- Associate multiple email addresses with the same user account, so they can log in with either
- How to make and save custom form in custom plugin page?
- Secruity Questions on a timer
- Redirect returning users to a certain page?
- Redirect User to custom URL after registering
- User Data Handling between two plugins
- Allowing duplicating users with same user_login and user_email
- Using custom IDP with WP
- Buddypress: adding a new tab direct user to their author page
- how to add security questions on wp-registration page and validate it
- Problem in plugin debuging in wordpress
- Buddy Press restrict the capability to edit users
- BuddyPress and namespacing
- Custom premium registration form and profile page for a WordPress Web Application
- Custom Registration Form and Passwords
- User Registration Moderate
- How do I control the list of Pages an author can see?
- Registration form Plugin… Email confirmation
- Use WordPress engine for user registration and management
- first_name property missing inside register_user action hook
- modify buddpress adminbar only in admin pages
- Create Unique and Customized User ID for Website Members in WordPress
- Rest Api WordPress
- How do I modify the error code array used by “shake_error_codes” filter?
- Making a user platform reachable by a qr code on a pin-back-button [closed]
- Get logged in user with – custom plugin
- WP 3.3 makes it possible to add meta box to Category Editor Screen?
- How to automatically activate a plugin on install
- disable defaault wordpress comments from a plugin
- using admin functions on frontend
- Widget internal hooks and functions
- Javascript Function Called Too Early in PHP Script
- Pause plugin option page until all data manipulation is complete
- How to display TinyMCE HTML view?
- WordPress plugin advice: suggestions for writing a plugin the correct way
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Why doesn’t my Table get created?
- Modify code for functions.php with specific twitter user url and hashtags
- Need Help Determining Where Header Error is Happening
- How to link to custom “archive like” page with custom permalink rules “dynamically”
- can members have multiple registration using the same password?
- How to automatically activate users after registration without activation email?
- Extract Information from post content (using regex?)
- Using jQuery prepend() with file include
- post content and shortcode content displaying out of order
- rewrite_rules problem
- Is it possible to have instead mypage.com/?page_id=81 to have mypage.com/cool/?
- How to add text editor in plugin menu?
- Development plugin to view and manage scheduled wordpress cron jobs?
- How to receive notification of deprecated API elements and functions?
- Using password protection to load different page elements?
- Add user managable titles to custom menus?
- Decontruct serialized data array from wp_options
- can’t access some WordPress function from my plugin
- How to properly create table in plugin
- How to Show Category List With Corresponding Links?
- Is it possible for two WordPress plugins to share the same code base?
- Set page to draft on plugin deactivation
- Can one plugin activate another plugin via script?
- Script to replace default blogroll with links to my social media URLs
- Create a Plugin to Download Files from Web to Server
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- How to deal with different jQuery versions?
- WP plugin repository didn’t parse readme.txt correctly
- How to show multiple instances of the WP125 Widget?
- Restore svn trunk of my plugin repository to the initial state?
- “Rendering of admin template [path to template] failed”
- Can I attach a plugin via my add_filter callback contents?
- Is there any way to pass messages from a script to a redirect target in a hidden fashion?
- What should I pass for $needed_dirs when calling _unzip_file_pclzip (aka PclZip)?