Support Forum

 
Current User: Guest
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

BUG + Fix (post_status: publish / published)

Working on It
No Tags
UserPost

5:01 am
August 1, 2010


JR

 
1

Hello Steph,

Just checking out your wonderful display-widgets plug-in.
Reporting what I think I found is a bug.

I innitially found that the plug-in shows not only published pages, but also pages with the new 3.x "auto-draft" status.
(database: table: posts -> column: post_status -> value: auto-draft)

Looking some more into this, I think I have found the culprit.
The plugin looks for pages with the status "published" in the post table.
But I think it should look for status "publish". (without "ed")

This is what fixed it for me:

display-widgets.php, on both line 51 and 101:

$pages = get_posts( array('post_type' => 'page', 'post_status' => 'published', 'numberposts' => 99, 'order_by' => 'post_title', 'order' => 'ASC'));

changed to

$pages = get_posts( array('post_type' => 'page', 'post_status' => 'publish', 'numberposts' => 99, 'order_by' => 'post_title', 'order' => 'ASC'));

(Didnt test this, but this could also be responsable for the plug-in showing deleted pages as mentioned here: http://blog.strategy11.com/for…..-in-list/)

7:57 pm
August 2, 2010


Steph

 
2

Funny… I just came across this issue with another plugin I was working on the night before you posted this. You're right about the deleted posts issue too. The problem was it was showing ALL the posts of any status since 'published' was invalid. There's an issue in the WordPress documentation on that function, where it says the default is 'published'. My bad for not testing it out very much. Thanks! New release to come shortly.

Working on It
No Tags

Reply to Topic:
BUG + Fix (post_status: publish / published)

Guest Name (Required):

Guest Email (Required):

Smileys
Cool Surprised Smile Wink Laugh Confused Cry Embarassed Frown
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
11 + 1
   


Working on It