use
add_action('publish_post', 'rhb_check_current_user');
and in your rhb_check_current_user function check using the global $post:
function rhb_check_current_user(){
global $post;
$author_id = $post->post_author;
...
...
}
Related Posts:
- How to get custom post_author?
- How to check username/password without signing in the user
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- WordPress REST API call generates nonce twice on every call
- Custom user profile, registration, login page with theme
- How to use WP default post list tables in a plugin?
- How to add quick edit and bulk edit fields to users admin section
- Generating User(s) with Settings API
- WordPress admin deleted user details not removed in database. How to delete WordPress Users from Database
- Print WordPress username id inside JavaScript
- Function Get User Object By Username?
- Check if someone is editing a post (this content is currently locked)
- Modify users.php page to create page/post on button clicked
- Subscribe to author?
- Comments do not respect display_name setting, how to make plugin to overcome this
- How to filter users list on user_status field with get_users()
- Frontend language per user
- Display custom fields in frontside user profile
- global $current_user not current user
- Display list of uploaded images, filtered by user under a specific user group
- What is the proper way to get logged in user id in a plugin?
- How to build a fool proof AdSense revenue sharing model?
- Hide custom post type by user roles
- How do I have now a duplicated user entry if this is not allowed (and I cannot replicate it)?
- How to allow only two (or more) users access to a plugin
- First and last name fields not filled when using wp_insert_user
- Wp-admin Custom User Management
- why do I have to use required parametres?
- Associate multiple email addresses with the same user account, so they can log in with either
- Update a user profile via frontend
- Best practice for Designing a Plugin with this scenario
- Adding another field to user table
- Change author permalink to external URL
- how to get the top 10 popular blogs
- How can I change my assigned user role in WordPress 3.5.1?
- How to relate the Category to user?
- Adding a dropdown on the user admin
- Allowing duplicating users with same user_login and user_email
- Why User_login key doesn’t work with wp_update_user()
- How to grab data after wp user search is complete
- How to prevent users from deleting their accounts?
- User Registration Moderate
- How to retrieve custom profile fields associated with different users
- Upgrade routine: Interaction with user confirmation
- Multiple Users Logged In Causing Incorrect Account Returned
- Create pages for authors
- first_name property missing inside register_user action hook
- How to set/change another post author by custom fields or something else?
- user can login from single account detail from multiple locations(computer) at the same time [closed]
- Create Unique and Customized User ID for Website Members in WordPress
- Post meta vs separate database tables
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- How to use PanelColorSettings in custom Gutenberg block?
- Replace audio/video enclosure with player?
- How do I print a notice only on certain admin pages?
- Unit testing wordpress plugins with plugin options
- Create a clickable name in WP_List_Table for Plugin Admin
- Plugin development without Theme adjustments?
- How to Make a Category Always Selected?
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- DataBase connection problem with PHPUnit and WordPress
- Plugin settings not saving
- Registering and using actions which return results in a Plugin class
- How to replicate Media Library “Add New” on Plugin Settings Page
- WooCommerce Conditional Tag inside plugin
- Add code inside specific wordpress standard function
- Conditional hook based on the core function that is calling it
- Best way to save custom css for an block
- How to hook a custom user function to a wordpress core ajax action?
- Sending post request with wp_remote_post not working correctly
- Plugin callback page
- Is nonce in PHP form and Ajax both necessary?
- How to add WordPress Admin “Insert Link” UI (searches through existing posts for URL) and functionality into a custom plugin?
- Input in plugin widget does not allow spaces
- White screen when activating plugin that sends form via WordPress
- dbDelta SQL Query Not Working
- A question about add_action()
- jquery in wordpress plugin with depdendency
- wordpress automatic update does not run
- Ajax +wordpress onClick link redirect to new page and create html content
- Cannot select certain authors for posts after import
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Script to replace default blogroll with links to my social media URLs
- How to show multiple instances of the WP125 Widget?
- Posts form with AJAX request – Plugin development
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Where to add functions and code snippets in wordpress
- Save meta box data from selected dropdown list in bbpress reply form
- Sanitize WordPress Array Input?
- WC REST API Error Handling
- Creating a virtual page without exit
- Allow user to change homepage
- wp_mail links are dead
- Use different archive template for plugin
- Get custom wp_query search results to appear on search.php
- Is it safe to use PUT and DELETE requests
- Multi-part form and wp_redirect()
- Sharing changes to a post (preview changes) with another user