I am not sure if that is built in, but you can try adding something like this to your functions.php
function set_publisher( $new_status, $old_status, $post ) {
$publisher_id = get_current_user_id();
if ( $new_status == 'publish' && $publisher_id > 0) {
update_post_meta($post->ID, 'post_publisher', $publisher_id);
}
}
add_action( 'transition_post_status', 'set_publisher', 10, 3 );
And then when you want to get the publisher you use
$publisher = get_user_by('id', get_post_meta(get_the_ID(), 'post_publisher', true));
Related Posts:
- How to add a checkbox inside the “Publish post” widget?
- publish_post action hook not working
- Plugin that generates a page of post content
- remove_action or remove_filter with external classes?
- Why does save_post action fire when creating a new post?
- add action only on post publish – not update
- Difference between do_action_ref_array() and do_action()
- Why is there both a save_post and wp_insert_post action?
- When is admin_init Action ran?
- Can an action callback prevent the parent from continuing execution?
- How do I enqueue a script to run inside the Gutenberg editor?
- How can I find out what functions are assigned to actions?
- Disable WooCommerce action
- How can I remove the WP menu from the admin bar?
- add_action customize_register not working
- Passing arguments into ‘init’ function
- How to use conditional add_action for WordPress
- WP Schedule Event – Every Day When First Visitor Comes
- How to remove an action that is added inside a class
- add action which returns modified value
- WordPress admin WP_table_list show incorrectly
- What’s the usage of action do_meta_boxes?
- Custom bulk actions in WP 3.7.1
- Custom function for “Submit for Review” hook
- Modify query in pre_get_posts action is messing up my nav menu
- Exclude trash from save_post
- How to check if an action is already fired?
- add_action and wp_head not display content in head section
- use add_action(‘wp_head’) in a widget
- Preventing frontpage to be deleted/moved to trash
- Selectively applying action based on role
- How to remove a custom action on child theme?
- How to run a function when post is edited or updated using publish post action?
- Action hook on only publishing post not on editing or updating
- how can I use add_action run another function when publishing new post?
- Performance : Duplicating `add_action`
- add_action in class and use it in theme
- Better action hook for creating table than after_switch_theme and switch_theme action hook
- Adding the hook ‘vc_before_init’ inside a object
- How to apply action the_post to the post that is only being mainly displayed
- admin_notices on runtime in function
- Using several add_action with parameters inside a class
- Make the Status, Visibility, or Date fields opened by default in the Publish box
- Action hook load_textdomain $domain variable
- Action hook for editing post
- add_action and do_action: multiple calls to same callback?
- Gutenberg – Dispatch action or setAttributes() on Post Save/Update action instead of onChange listener
- remove_action returns false regardless of priority
- Set a custom display_name on user_register?
- Custom post type suppress transition from future to publish
- WordPress action admin_post for non-admin authenticated users – Form submission
- Instantiating classes through add_action and saving them to user_meta data [closed]
- Set meta field to publish date + 2 weeks
- How to make an action run in the background?
- WP cron doesn’t pass through my arguments
- how to add submenu item under parent menu item with code
- Copy post to separate database with “add_action(….)”
- Why does my wp_safe_redirect output the ERR_TOO_MANY_REDIRECTS error?
- Re-order Woocommerce single product and echo div around moved & duplicated Woocommerce hooks
- Custom Post type forgetting data
- Insert custom postmeta when custom post type published
- Call do_action class’s function
- I would like to send a notification email (Asana) whenever something is published (posts, pages, custom post types) [duplicate]
- Create post revision on slug change
- Is dynamic action name building a bad practice?
- Can’t Get Metabox Data Saved Assistance Needed
- missing argument 2 when passing arguments to add_action
- is there an update_post_meta action
- add_action hook for publish_post not working
- A unique wp_schedule_single_event() for each post?
- comment_post callback function: how to run it in the background.
- Is this the correct way to enqueue style sheets from parent theme and then from child theme in wordpress?
- Change Post Publish Date to Post Modified Date in All Places
- Action ‘init’ function doesn’t return variable
- add_action to wp_head is added, but not called
- Where to place add_action when enqueueing?
- add_action before theme setup
- add_action which contains first argument admin_print_scripts-$page
- update_user_meta not updating
- How do i know which action / filters are called when i call get_option()
- How can I get more out of `$post` in an `add_action` callback?
- Restrict editing of post type to list stored in user meta
- Remove action not working in child theme
- Call to Action Button – Resize Help [closed]
- Translate are not working for standard admin
- add_action init breaks site on PHP 7.1
- Why is this require statement not working?
- action future_post returns wrong date
- XML Imported Custom Posts
- Hook into admin_notices after sending mail
- WooCommerce wp_insert_post action firing on every save
- WordPress’ work or execution flow manipulating $wpdb
- How to enable/disable a hook with theme options
- Add-action in function
- Building WP Web App: Creating a Feed for post revisions
- Can admin_bar_menu or another action be used to modify the admin bar on the admin side?
- What is the first action or filter executed by wordpress?
- Using add action for class with construct
- Action while post is being published
- Webhook: save_post action fires wp_remote_post twice