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]
- Is There a Plugin Life Cycle Documentation?
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Shortcode adding p and br tags
- Install and load additional plugins when running unit tests
- Having Problem On Getting WP Post Gallery Images URL
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- Can I dynamically create a link to my plugin settings/options page from my plugin description?
- How to load the plugin only when logged in?
- Hook into theme-switching later than `setup_theme`
- Save image as featured image
- WP AJAX is not working, always returns 0
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- WP REST API V2 – Add user data to response
- Applying OO patterns and principles to plugin development
- How to schedule a cron job in plugin without waiting for page load request?
- Is it possible to change a term slug before being saved to the database?
- Replace youtube embed in wordpress
- Admin – Handle data before creating or updating a post, page or custom post
- wp_redirect on base wp-admin and login
- Valid filenames for add_action’s first parameter
- What to hook into to check a value before a post is published?
- Correct syntax for database inserts from plugin?
- How to add a gradient component to a custom block
- wp_schedule_event() set daily, but processed every second
- $wpdb->update() always need a second try
- Why aren’t some plugin styles loading when I load a template?
- Pagination not working with custom wp_query
- WordPress actions for plugin admin UI page
- wp_insert_user keeps echoing values
- Pause plugin option page until all data manipulation is complete
- Exclude Woocommerce Product Category From Sitemap
- How to show only the last two categories in a menu?
- howTo let wordpress endpoint return html-page
- User meta query using Wildcard
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Dedicated server and WPDB Class : huge slow-down of the website
- How can I see a varibles value when my plugin runs?
- Add Button to TinyMCE Custom Menu
- How should I use wpdb class to submit a form in admin dashboard?
- view and update form only for registered users
- Create pages for authors
- How do I create Widget within plugin that uses its own class?
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- WooCommerce adds a newline symbol (\n) between email recipients