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 in future_to_publish function

Hi @epaps:

So I tested your code and it all works fine. The $post is passed in as an object and you have full access to the $post->ID variable. Best I can tell is that you have some kind of plugin interaction that is causing it to fail or that, for some reason the scheduled task is not being called (but if the future post is indeed being published then the latter potential does not seem possible.)

Hmm, without your full code to debug I’m stumped. If you come up with me information maybe I can help you find it.

P.S. Here was my first answer which was clearly wrong: Could it be that you meant to use the 'publish_future_post' hook instead of 'future_to_publish'?

Related Posts:

  1. Enabling Sessions in WordPress 3.0
  2. Manipulating post meta in the customizer
  3. How to let a single post have its own domain name
  4. simple wp_insert_post example
  5. Best way to pass arguments to another page in WordPress
  6. WordPress change author email notify message?
  7. Set user loggin status?
  8. How to remove tag cloud from taxonomy admin edit page?
  9. Author Tracking Code!
  10. Add a date updated/date modified option using custom fields
  11. Get Custom Logo Alt Text
  12. result from custom filter admin table list backend does not work
  13. Problem with custom function from jQuery slider tutorial
  14. Different profile page by role
  15. Add array of post id’s to a category?
  16. Delete post meta by serialized meta value
  17. Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen
  18. Stored meta from attachment, video length?
  19. Best collection of code for your 'functions.php' file [closed]
  20. How to: Easily Move a WordPress Install from Development to Production?
  21. Is there a flowchart for WordPress loading sequence?
  22. Essential technical features for high-end WordPress web hosting? [closed]
  23. How to remove admin menu pages inserted by plugins?
  24. How to put logs in WordPress
  25. How to get the Date Format and Time Format settings for use in my template?
  26. what is the correct way to compare dates in a WP query_posts meta_query
  27. Explanation of update_post_(meta/term)_cache
  28. Add multiple custom fields to the general settings page
  29. Where are Additional CSS files stored
  30. Best Practices for Regression Testing WordPress Websites?
  31. Remove wrapping div and ul from output of wp_nav_menu
  32. Attaching taxonomy data to post with wp_insert_post
  33. What Is The Use Of map_meta_cap Filter?
  34. get post author id outside loop
  35. Custom Walker: how to get ID in function start_lvl
  36. Creative uses of WordPress [closed]
  37. How to *remove* a parent theme page template from a child theme?
  38. How do I make my child theme re-apply the settings that were customised when its parent was active?
  39. Multiple Inputs in a Customizer Control
  40. New WP_Customize API – how does it work under the hood?
  41. Embedding a SOAP Client into a WordPress Plugin?
  42. Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
  43. Update widget form after drag-and-drop (WP save bug)
  44. Data sanitization: Best Practices with code examples
  45. How to benchmark a WordPress installation? [closed]
  46. Should I delete the default themes?
  47. Moving WP install from local to live, what about wp_posts GUID?
  48. Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
  49. Running Gutenberg React in Development Mode
  50. Prevent WordPress from automatically installing a new theme each year
  51. Can we use one WordPress installation for multiple databases, domains and content directories
  52. Is there a blank theme framework compatible with WP 3.0? [closed]
  53. Using classes instead of global functions in functions.php
  54. Plugin SVN & update API – how are plugins identified?
  55. When should you, and when should you not, use wp_list_pluck()?
  56. Function to return true if current page has child pages
  57. Correctly delete posts with meta and attachments [duplicate]
  58. Users with custom roles not showing in post author select box
  59. How to use more than 256MB of memory in the admin?
  60. How do register_sidebar() and get_sidebar() work together?
  61. How do you get formatted content of a post using the WordPress API?
  62. Localization: I want the backend: english and frontend in defined language
  63. Are there any forks of WordPress (and what is different about them)?
  64. How to Change 404 page title
  65. Make Custom Metaboxes Collapse by Default
  66. WordPress Paginate $wpdb->get_results
  67. Display random categories on the front page (Finding and Editing Theme Functions)
  68. Shared functionality in plugins and themes
  69. Custom maintenance page
  70. Add button to TinyMCE bar without creating a plugin
  71. Why do I get the timeout warning?
  72. How to add a new product type on woocommerce product types? [closed]
  73. How to include own css on wordpress tinymce editor?
  74. How to disable page delete
  75. add button to post edit page when post_status=publish
  76. how to override woocommerce specific loop or archive-product.php [closed]
  77. Removing Metabox for “Slug” without removing functionality
  78. Modify existing plugin function using filter (without modifying the plugin directly)
  79. Rename UPLOADS folder with custom WP_CONTENT_DIR
  80. WordPress hook before inserting post into database
  81. Any post install tips after installing WordPress 3.0.1?
  82. Making Custom Fields Standard in the Admin UI
  83. Remove WordPress theme from a specific page
  84. Remote upload file to server B
  85. Version Control: Entire site or just pieces?
  86. Getting a stack trace when an error occurs?
  87. Check for and enforce unique value in user-entered custom meta field in WP Admin
  88. Cleaning up WordPress to improve performance?
  89. Backup the Database and Restore from the Backup?
  90. Change admin bar to default:off
  91. get_pages() not ordering as it should
  92. Scaling a WP eCommerce site
  93. Custom Search Query
  94. How to remove comment section from page only , not from posts pages?
  95. List of all theme customizer control types?
  96. Looking for a lightweight theme using WP3 new tags and features (not 2010) [closed]
  97. Why doesn’t WP_Image_Editor save images using the Filesystem API?
  98. Pitfalls when Distributing Plugins that Access SOAP Web Services?
  99. How to get current_cat in navbar, in single post
  100. Default value for add_settings_field
Categories customization Tags customization, functions, post-meta
Proper implementation/use of code/syntax highlighting
From what hook on is it possible to conditionally add actions?

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