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