Opened 16 years ago
Closed 16 years ago
#12842 closed defect (bug) (fixed)
Future dated custom posts miss schedule
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.0 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Posts, Post Types | Keywords: | has-patch dev-feedback needs-review |
| Focuses: | Cc: |
Description
My installation of WP3 has absolutely no problem with future dated regular posts, but when future dating a custom post type the custom post misses schedule each and every time. I have absolutely no clue as to where things go wrong.
Here's the code I'm using:
add_action( 'init', 'twms_register_post_types', 100 );
function twms_register_post_types() {
register_post_type('tweet', array(
'label' => __('Tweets'),
'singular_label' => __('Tweet'),
'public' => true,
'exclude_from_search' => false,
'supports' => array(
'title'
)
));
}
Attachments (1)
Change History (10)
#1
@
16 years ago
- Summary changed from Future dated custom posts mis schedule to Future dated custom posts miss schedule
@
16 years ago
Removes default hooking _future_post_hook to future_post and future_page and moves it to register_post_type
#3
@
16 years ago
The problem was the following:
In wp-includes/default-filters.php the function _future_post_hook is hooked to future_post and future_page. This assumes that there are no other post types. In my patch I deleted the lines that do this and added the line
add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 );
to the register_post_type function. This takes care of future post capability for any post type that's created. This seemed like the most elegant way of doing this.
Some additional info: I checked out the cron value in the wp_options table and there is no event scheduled for any of my future dated custom posts.