Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Access post meta just after publishing

Here is the description of transition_post_status from the codex:

This function’s access is marked as private. That means it is not
intended for use by plugin and theme developers, but only in other
core functions. It is listed here for completeness. Use any of these
functions instead.

Why not use the publish_post action instead? There is a nice article + example in the codex which covers your case. It sends an email whenever a post is published and sends the post data.

Edit 1: As @Pieter Goosen pointed I’ve looked at different function (_transition_post_status() instead of the hook transition_post_status). Please disregard my post about it’s description. Sorry for the confusion!

Related Posts:

  1. Access post meta just after publishing
  2. How to hook update_post_meta and delete_post_meta?
  3. What is the difference between update_post_meta and update_postmeta hooks?
  4. How to call a REST endpoint when a post is published?
  5. Returning ACF custom field from publish_post
  6. Update post meta using pending_to_publish hook
  7. new_to_publish fires multiple times
  8. Post Meta Emtpy on Publish Using Transition
  9. get_post_metadata causing some meta data to fail
  10. I would like to send a notification email (Asana) whenever something is published (posts, pages, custom post types) [duplicate]
  11. add_action hook for publish_post not working
  12. run script on publish
  13. post.php AJAX request not being called when publishing post
  14. How to stop WordPress from updating the post meta
  15. Where is publish_post hook fired?
  16. Custom posts and get_post_meta in {$post_status}_{$post_type}
  17. Post via wp-admin and via iOS app, same hooks and triggers involved?
  18. calculate values from a field and insert them into custom fields when publishing or updating post
  19. Why does get_post() not return anything?
  20. WP-Automatic to run publish hooks
  21. disable publish button until condition is not met
  22. How to hook into publish_posttype?
  23. Function is Missing an Action Hook
  24. Is there a way to send HTML formatted emails with WordPress’ wp_mail() function?
  25. How to get WordPress’ hooks/actions run sequence?
  26. Where can I find a list of WordPress hooks?
  27. Is there a save_post hook for custom post types?
  28. Where is the right place to register/enqueue scripts & styles
  29. How to know what functions are hooked to an action/filter?
  30. Are there any hooks that alter the 404 logic?
  31. Is there a hook that runs after a user logs in?
  32. Difference between do_action and add_action
  33. WP Cron Doesn’t Execute When Time Elapses
  34. WooCommerce: change display order of product short description and price [closed]
  35. Why do some hooks not work inside class context?
  36. Difference between after_setup_theme and init action hooks?
  37. get $post in init filter or action?
  38. Use wp init hook to call other hooks?
  39. How many times can I hook into the same action?
  40. How do I implement the WordPress Iris picker into my plugin on the front-end?
  41. How to intercept a 404 error
  42. Move excerpt meta box to above content editor
  43. Action hook for custom tax edit
  44. Trigger custom action when setting button pressed
  45. What is “all” in isset($wp_filter[‘all’])
  46. Whats worth using add_action when we can simply use add_filter?
  47. Is there a limit to hook priority?
  48. Please explain how these hooks work
  49. Add_action to wp_head via functions.php
  50. Hook after image is uploaded and image sizes generated
  51. Is there a hook before the user is authenticated?
  52. Hook that fires when admin setting is saved
  53. add_action(‘wp_ajax_[action name]’, myfunction) problem
  54. Hook ‘wp_enqueue_scripts’ priority has no effect
  55. Hook on trash post
  56. Hook *after* user password change?
  57. Auto-retrieve YouTube Image for Thumbnail?
  58. Which hook if user profile information is updated?
  59. How to remove action hook done in a plugin from functions.php in my theme?
  60. Hooks for trashing, deleting, saving, restoring custom post type
  61. Is there a WordPress core & plugins update action hook?
  62. Hook into WordPress update?
  63. trigger save_post event programmatically
  64. Implementing advanced add_* function wrappers
  65. Adding onload to body
  66. My add_action (wp_footer, ‘method’) is not calling?
  67. Do WordPress Core Filenames Work as Hooks?
  68. What is the earliest possible hook for safely using `is_front_page`?
  69. switch_to_blog(): Load textdomain
  70. __NAMESPACE__ with register_activation_hook
  71. Can I hook inside another hook?
  72. Adding function directly vs using hook in function.php
  73. Are hooks called synchronously?
  74. How to check if which hook triggered the call to a function?
  75. How can I send to multiple Contact Form 7 recipients based on form input? [closed]
  76. Hook into wp_head(); in a plugin
  77. Send data to 3rd party api with wp_remote_post on wp_login
  78. is it possible to get the hook name in add_action?
  79. Hook for URL Request
  80. How do I flush the rules after saving settings using the Settings API?
  81. Run javascript code after wp_login hook?
  82. Does anyone have a visual breakdown of core hooks and when they are fired?
  83. How to customize the WP admin default help contents
  84. What is the action hook for save media-form on gallery tab?
  85. What hook is executed just after wp_query has been executed?
  86. Hide gutenberg option blocks
  87. The ‘user_has_cap’ hook seems to take two page loads to trigger
  88. How and where can we request new WordPress hooks to be added?
  89. How to access the post meta of a post that has just been published?
  90. Disable block from editor based on post type
  91. WordPress Admin Tooltip hooks
  92. Difference between hooks Plugin_loaded and admin_int?
  93. Wp_update_post: Infinite loop even with remove_action solution, OOP
  94. Hook/notify when any option or setting is added or updated
  95. Is it possible to save/modify a post without calling the “save_post” action hook?
  96. Which hooks is this? add_action(‘wp’,
  97. How to programmatically create a connection with [Plugin: Posts 2 Posts] on cpt publish?
  98. How to show an error message after publishing a post?
  99. Redirect logged in users if they are on a specific page
  100. Make W3 Total Cache “Empty All Caches” function purge varnish [closed]
Categories hooks Tags hooks, post-meta, publish
Create a new table on the database and save parameters from a contact form
Adding a menu item to the main menu

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress