/** * Returns a string for displaying which dates the schedule is manually excluding * * @param integer $post_id * @return string */ function bfox_plan_excluded_dates_text($post_id = 0) { $excluded = bfox_plan_meta('excluded_days', $post_id); $excluded_dates = (array) $excluded['Y-m-d']; foreach ($excluded_dates as &$exclude) { if (is_array($exclude)) { $exclude = implode(':', $exclude); } } return implode("\n", $excluded_dates); }
function bfox_plan_scheduler_for_post($post_id) { $scheduler = new BfoxPlanScheduler(); $scheduler->setStartDate(bfox_plan_meta('start_date', $post_id)); if ($scheduler->startTime()) { $scheduler->setFrequency(bfox_plan_meta('frequency', $post_id)); $scheduler->setReadingsPerDate(bfox_plan_meta('per_day', $post_id)); $scheduler->setExcludedDates(bfox_plan_meta('excluded_days', $post_id)); } return $scheduler; }
function bfox_plan_update_frequency_rss($post_id = 0) { return apply_filters('bfox_plan_update_frequency_rss', (int) bfox_plan_meta('per_day', $post_id)); }