Skip to content

Commit

Permalink
Fixing the is_drafted method
Browse files Browse the repository at this point in the history
Resolves #452 and #435
  • Loading branch information
AramZS committed Dec 8, 2014
1 parent 129ad8c commit 021954d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion includes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ public function form_of_an_item($item, $c, $format = 'standard', $metadata = arr
$ibox .= '<br /><a class="edit_draft_from_info_box" href="'.$edit_url.'">' . __('Edit the draft based on this post.', 'pf') . '</a><br/>';
}


$ibox .= '</div>';
echo $ibox;
?>
Expand Down
5 changes: 3 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,9 @@ function pf_is_drafted($item_id){
'post_type' => 'post'
);
$q = new WP_Query($a);
if (is_array($q) && (0 < count($q))){
return $q[0];
if ( 0 < $q->post_count ){
$draft = $q->posts;
return $draft[0];
}
else {
return false;
Expand Down

0 comments on commit 021954d

Please sign in to comment.