There’s no direct way of getting the post author’s email from a post. You can get the email by using the author ID, which is present in standard WP_Post object.
$post_author_id = intval( $post->post_author );
$post_author_email = get_the_author_meta('email', $post_author_id);
Or if you just have the post ID
$post_author_id = intval( get_post_field( 'post_author', $post_id ) );
$post_author_email = get_the_author_meta('email', $post_author_id);
Or if you want, you could also hook custom function to save_post
action and save the author email to the post’s meta, when the post is created. Then you could get the email with get_post_meta()
using post ID and the custom key you used to save the meta.
Related Posts:
- Issues with title-tag and document_title_parts
- Use author author display name in permalink structure for pages and posts
- Import WordPress XML File from Within Functions.php
- Define custom Page Template without its own .php file
- Possible to search by author name with default WordPress search function?
- Does hooking into the same action multiple times drain memory?
- How to influence the information displayed on widget inside wp-admin
- Extract image from content and set it as the featured image
- Is there a hook or function I can use to display all theme files being used on a current page?
- Issue with get_theme_mod returning a blank value instead of the saved value
- Add action hook conditionally – only when home.php in use
- Show modified time if post is actually modified
- why doesnt is_home() work in functions.php
- Add admin bar link to edit author
- How to create thumbnails for PDF uploads?
- Implementing DNS Prefetching with WordPress
- Help me to understand wp_header() and wp_footer() functions
- How can I tell if I’m on a login page? [duplicate]
- In WooCommerce I need to modify the thankyou.php page [closed]
- How can I add an extra WooCommerce hook
- Why get_header() or get_footer() does not run twice if called in the same php file?
- Remove Page Title from Static Frontpage
- How to override WordPress registration and insert an auto-generated username?
- Set default options for inserting media
- Authors details such as social media links, emails etc → Is this Meta or something else?
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- How to hook into the quick edit action?
- Display the number of user comments
- gform_after_submission content appears immediately after , not in post body [closed]
- How do I change parameters without changing the core
- Is it possible to be more page/post specific with admin_enqueue_script?
- WooCommerce add_action hook results in 500 error
- Issue adding text after short description on product pages Woocommerce [closed]
- Customize “the_posts_pagination” and put list instead div
- Increment price for Woocommerce Minicart [closed]
- how to change link of some wordpress pages
- Gravity Forms field entries into wp_query loop [closed]
- Post thumbnail relative link and HTML modify
- Proper way of using functions in action hook?
- Hide Author.php template from specific user role
- How to preserve edits to Name or Slug of term when using wp_update_term on save?
- Accepted arguments value in hook functions
- Get current page_id before loop, in functions.php
- How to properly add function called by action-hooked function to functions.php?
- Which action hook to use for function?
- Change size and crop medium_large images
- Gravity Forms – Using a Form to Pre-populate A Gravity Form [closed]
- How to automatically remove links from WordPress Biographical Info?
- Running a script before absolutely everything
- Inserting a functions output after the content
- How to display post content instead of excerpt
- Changing the text of Upload/Insert on Posts and Pages Screen
- Filter for replacing the WP_query object for a given category
- How to add or delete default value theme options while activate and deactivate theme
- WordPress comment processing . Default unapproved comments detection before posting
- Warning at top of website & top menu gone
- Does hook have an effect on increasing the page load?
- Save_post – Warning: Cannot modify header information
- What is the earliest Hook a Script can use?
- Populate acf-field, depending on block name
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- custom error message for empty username and password using authenticate filter not working
- How Do I Unhook This Parent Theme Function?
- Author social media aren’t shown on the page
- Calling hooks in functions
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- How to add custom column into custom post, when field is select
- How can I stop the hook from breaking the login/logout function?
- True email confirmation for registration (keeping unvalidated users from user table)
- Author Page User id in functions.php for non login user
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- How to echo the translated custom field?
- Author info does not show up when author has no posts
- Function the_content
- save_post hook – headers already sent?
- Show the online status of the current post’s author
- Init hook for header send
- Add custom fields after post/page title
- Force resize for all video content
- Unhook the comment form in Buddypress
- How to Insert A List of Posts in A Category Written by the Author into the Author Archive
- Why wp_ajax hooks doesn’t work?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Why functions metaboxes is causing White Screen in Admin [closed]
- How do I add functionality to images?
- How to hook wp_mail to add a custom email as BCC for each sent email?
- Assign new post author IF another user in custom field on post transition
- image_size with respect to aspect ratios
- delete_term is not working properly with add_action()
- Get category of post inside save_post hook
- Create section wit form
- How to add user_registered time in human_time_diff() wordpress
- Log in and out using custom pages, no logout confirmation and redirects for logging in and out 2023
- Copy and Modified WooCommerce function is_coupon_valid [closed]
- Function attached to cron job not running but will run if called manually
- How can I able to exclude ‘Category’ and ‘Tag’ slug from the URL in WordPress without reloading to new site?
- Redirecting after login except for a specific page
- Include posts under a custom taxonomy in author.php