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

Is there a way getting post fields using `transition_post_status`

I’m not sure why get_post_field wouldn’t work in this situation, but if you can access $post->ID, you should also be able to get $post->post_title and $post->post_content (and even $post->post_excerpt if it’s there).

The $post object includes the standard metadata, like author and publication date. Any metadata in the wp_postmeta table in the database can only be found with $post->ID, with which you should be able to get your metadata using get_metadata. Failing that you can always run a query on the database directly. Since plugins have quite some freedom in structuring their metadata it’s not possible in general to say how to structure this query. Also: read Otto’s note on this.

Related Posts:

  1. Setting post meta data to random value during post status transition / on publish
  2. How to check if post meta key exists or not in wordpress database
  3. How to add category to: ‘wp-admin/post-new.php’?
  4. How to Display a List of Users Who Have Made at Least 1 Post?
  5. How can I retrieve multiple get_post_meta values efficiently?
  6. Code to make a post sticky
  7. Let private posts stay in status “private” after edit through “editors”
  8. How to allow hidden custom fields to be added from wp-admin/post.php?
  9. Export WordPress Posts and Meta Information in CSV format
  10. Delete duplicated wp_postmeta record
  11. Will a large postmeta table slow a site down?
  12. Update all posts automatically when using post_meta
  13. How to batch update post content with custom post meta value
  14. Change slug with custom field
  15. Better post meta efficiency?
  16. featuring old articles without messing up with the archive
  17. Edit meta data does’t work with custom sql
  18. How to change post status from publish to draft using hook in wordpress?
  19. Hiding by default specific post status on backend list?
  20. Human Time Diff, change mins to minutes
  21. Enable commenting on front-end preview page for pending posts
  22. Change post format using custom field
  23. Does WP get all post_meta on POST page?
  24. Custom Post Status Posts viewable to the public
  25. Sanitizing `wp_editor();` Values for Database, Edit, and Display
  26. Exporting Data from WordPress into a flat table
  27. Adding Multiple Values to a Post Meta Key
  28. Using radio button meta data from a custom meta box
  29. How can a guest view the “Pending Review” Post?
  30. How do I batch create revisions of all posts?
  31. add filter to “quick edit menu” in wordpress admin
  32. ‘transition_post_status’ only fires when pressing “Add New”
  33. PHP Notice error (when on 404 page)
  34. What Is meta_id In wp_postmeta?
  35. What differences are there between a Privately Published post and a Draft post?
  36. Checking if a post with certain meta value exists
  37. How to permanently delete a post meta entry?
  38. Add custom field automatically (add_post_meta) with value based on number of words of article
  39. How to generate numbers indistinguishable for the IDs of the posts
  40. Modify WP_Post before processing
  41. Save re-arranged draggable post items to wordpress database
  42. Update post status from “publish” to “trash” for half of posts
  43. I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
  44. Change post_date to post_modified date on post template?
  45. How can I set a Post’s default visibility to private and pending review checked
  46. Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
  47. how to remove dash (-) post status from post title on posts listing page wordpress
  48. Email Post Attachment on wp_insert_post Action
  49. How can I sort posts by the date and a custom meta field?
  50. is there a way to show the the post title after the image?
  51. Get Meta Key Value While Saving Post
  52. How to change post status from frontend?
  53. Force the “Choose from the most used tags” meta box section to always be expanded
  54. Update postmeta Parent when post_status child change
  55. Meta value does not save for scheduled posts
  56. Custom Posts Query and meta_query Sort Order
  57. Posts and Attachments with “Published” status in Search
  58. How to compare two posts including their meta fields on a scalable base?
  59. Getting value from get_post_custom
  60. Calling Different Custom Post Timestamps in a table
  61. Admin – create custom post status and display above table
  62. Is it possible to paste a link without tags and make it directly a link in a post?
  63. Restrict edit, but allow preview for custom post status
  64. WordPress capabilities on pending post status
  65. Cannot retrieve a custom RSS field from posts
  66. Saving custom fields to a custom taxonomy
  67. How to automate featured posts number? [duplicate]
  68. why there are so many posts whoes post_type is revision? will these records waste too much database space?
  69. Customize rel=canonical tag for single blog post
  70. Change all author links in Blog roll
  71. How to I retrieve the ID from the Posts page?
  72. $post->post_type not working
  73. How to save meta checkbox WordPress
  74. how can i allow users to view their own pending posts in a front-end page
  75. How to calculate the average of a post meta value(Numeric) of a specific author
  76. Is there any way to tell when wp_postmeta has been updated?
  77. wpColorPicker – problem with implementation to post meta
  78. Change post author without using wp_update_post()
  79. if in category but only with post meta
  80. wp_query with ajax
  81. Update post meta within save_post action
  82. Display post number by category
  83. Updating post meta for checkbox
  84. Saving Post Data in Another Database
  85. Custom permalink for each post
  86. How can I tell if a post has been published at least once?
  87. Automatic blog page with custom design [closed]
  88. Add multiple meta keys to a post at once
  89. Show number of posts by logged in user
  90. How does WP decide how to display a page
  91. What function publishes a post when you click the publish button?
  92. When sending a newsletter -not with wordpress- the server has 100% cpu [closed]
  93. Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
  94. Insert data from custom created PHP page into wp_postmeta table
  95. Post Status Frontend Announcement
  96. Adding a meta box to determine the sidebar [closed]
  97. The loop starting at a certain ID
  98. Display amount of pending posts in back/front end
  99. saving/reading custom field value does not work – no value gets POSTed
  100. Simple Custom Metabox Not Saving
Categories posts Tags post-meta, post-status, posts, wp-mail
“Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
Trim content without stripping formatting

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