Plugin Directory

Changeset 553671


Ignore:
Timestamp:
06/06/2012 05:39:57 AM (14 years ago)
Author:
beezeee
Message:

Fix issue where sticky posts still show up after being deleted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • category-sticky-posts/trunk/bz_category_sticky.php

    r452293 r553671  
    55 Description: Set sticky posts for individual category archives
    66 Author: Brian Zeligson
    7  Version: 0.11
     7 Version: 0.12
    88 Author URI: http://www.workinginboxershorts.com
    99
     
    146146    $cat_obj = $wp_query->get_queried_object();
    147147    if (!is_array($this->bz_sticky_categories[$cat_obj->term_id])) return $posts;
    148     foreach($this->bz_sticky_categories[$cat_obj->term_id] as $bz_cat_sticky_post => $val) $newposts[] = get_post($bz_cat_sticky_post);
     148    foreach($this->bz_sticky_categories[$cat_obj->term_id] as $bz_cat_sticky_post => $val)
     149    {
     150        $sticky_post = get_post($bz_cat_sticky_post);
     151        if ($sticky_post->post_status === 'publish') $newposts[] = $sticky_post;
     152    }
    149153    foreach($posts as $post) if (!isset($this->bz_sticky_categories[$cat_obj->term_id][$post->ID])) $newposts[] = $post;
    150154    return $newposts;
Note: See TracChangeset for help on using the changeset viewer.