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
- Best way to distribute templates and code accross multiple wordpress sites?
- Schedule some work in custom plugin
- What is the replacement for rich_edit_exists()?
- Disable Auto-Expanding Menu in WordPress Admin Menus
- How to overwrite iris color pallates from theme to plugin
- Get images / media attached to a page by page ID
- How to submit/upload data to database and in specific folder?
- OOP plugin not working
- About a programming language starts with [closed]
- Adding Custom CSS with PHP
- in_array function Problem
- Best practice for plugin: always detect admin-ajax call?
- custom wp_editor does not save the content in plugin settings
- Plugin Development: Storing and Manipulating Data That Fits JSON in Database
- How to set a header in wp_safe_remote_get()?
- Data inserted by wpdb insert is different than data pressnt in database.
- How do I force a download in the admin area?
- add_action wp_ajax_ not loading in plugin file WP Network
- get_avatar filter in WordPress 4.4, how to filter properly
- Cleaning a filename after image sideloading a url that contains `%20`
- Proper Prepare Statement for ALTER TABLE and using AFTER
- How to use a WP_Customize_Control outside of the Customizer?
- Why is the form not updating when I select a new sector from the list?
- Multiple page plugin settings
- WordPress Plugin Development- When our plugin functions call?
- How to change a field in database through a submit button or Checkbox? [closed]
- Plugin creation, restricting access to specific roles
- Overwriting a plugin function
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- Get audio metadata on file upload
- Referencing files in JavaScript in WordPress Plugin
- How to Customize Polylang Language Items
- wordpress automatic update does not run
- Submit form to a different PHP file in the same plugin folder
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- How to list all images used on a specific page?
- Create fixed static pages
- Can calling wp_enqueue_style in wp_iframe apply the stylesheet to everything not just the iframe?
- WP Dropdown Categories, display subcategories but not grandchildren categories?
- How to get terms for taxonomy
- Copied files from plugin to theme not working
- How can I allow the user to press enter without creating a new element in the editor?
- wpdb->get_var always returning 0
- A function that will remove HTML and tags from a string?
- Information on plugin adding text when a post, page, or other such is displayed
- configuration of .htaccess for add_rewrite_rule to make sense
- Plugin working on my local installation but Cannot be activated online
- $wpdb->prepare is not working like mysql_real_escape_string
- How to insert HTML/CSS/JS into my iframe plugin?
- Workflow for new importer plugin – your advices?