[wp-trac] Re: [WordPress Trac] #3747: query.php - get_posts causing
ambiguous errors
WordPress Trac
wp-trac at lists.automattic.com
Mon Feb 5 14:56:05 GMT 2007
#3747: query.php - get_posts causing ambiguous errors
------------------------------+---------------------------------------------
Reporter: mhyk25 | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.3
Component: General | Version: 2.1
Severity: normal | Resolution:
Keywords: reporter-feeback |
------------------------------+---------------------------------------------
Comment (by mhyk25):
A sample scenario could be a plugin allows certain categories to be hidden
to guests users, where category ID of the private ones are collected and
stored in an object or array in the options table.
posts_join hook function appends this line to make sure that post2cat is
used:
$join .= " LEFT JOIN $wpdb->post2cat p2c ON $wpdb->posts.ID = p2c.post_id
";
posts_where hook function makes use of this table looping through an array
of selected category_ids to hide like so:
$where .= ' AND p2c.category_id != ' . $optObj->protected_categories[$x] .
' ';
This is fine when viewing other pages, but viewing a category will result
in an ambiguous error. If this sounds crazy and very wrong, I apologize.
Just point me in the right direction :P
--
Ticket URL: <http://trac.wordpress.org/ticket/3747#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list