has_post_thumbnail() Returns False on Scheduled Posts

Well it turns out that the reason has_post_thumbnail() was failing was because get_post_meta() was returning empty for scheduled posts. I’m still not sure why, but in case someone else has the issue, my workaround was to create a new function to fetch the featured image ID without relying on get_post_meta(): function get_featured_image_id($postID) { global $wpdb; … Read more

How to prevent people from seeing an attachment to a scheduled post that’s released in future?

WordPress is engineered exclusively to reside in web-accessible folders, unlike many less user-centric web frameworks, which separate locations of private (code, etc) and public (assets). Making filenames hard to guess is about as good as it gets with normal workflow. To have this really tight you would need completely custom workflow with files places into … Read more

How to Insert data with wp cron

First you can to create a schedule for one minute, then bind function with that hook. function add_new_intervals($schedules) { // add weekly and monthly intervals $schedules[‘every_single_minutes’] = array( ‘interval’ => 60, ‘display’ => __(‘Every Minute’) ); return $schedules; } add_filter( ‘cron_schedules’, ‘add_new_intervals’); // To schedule event for this minute event wp_schedule_event( current_time( ‘timestamp’ ), ‘every_single_minutes’, … Read more