Пример #1
0
function bermstyle_acf_save_post($post_id)
{
    if ($post_id == 'options') {
        $ids = bermstyle_get_featured_college_post_ids();
        set_transient('bermstyle_exclude_main_loop', $ids, 0);
        // no time out
    }
}
Пример #2
0
function bermstyle_exclude_posts($query)
{
    if ($query->is_home() && $query->is_main_query()) {
        if (false === ($ids = get_transient('bermstyle_exclude_main_loop'))) {
            $ids = bermstyle_get_featured_college_post_ids();
            set_transient('bermstyle_exclude_main_loop', $ids, 0);
            // no time out
        }
        //* we are expecting an array of post ids
        $ids = unserialize(get_transient('bermstyle_exclude_main_loop'));
        $query->set('post__not_in', $ids);
    }
}