Thank you for the great plugin. It is working exactly like my client needs.
I have link categories controlled by role scoper and the admin adds in links they want each role to work.
If I use the default link widget this works great. But the other requirement the client wants is a collapsing/expanding list of link categories with the links:
This plugin works exactly what I want it to do: http://wordpress.org/extend/plugins/collapsing-categories/
But it doesn't respect the role scope link categories.
I looked at the code and it is pulls in links & categories straight with a db query.
I can point you exactly to the lines 125 - 140 in collapsLinkList.php –
so I believe I want to join one of the role scopers tables and do a where to limit only bringing back categories & inks that user's role is allowed.
Thanks
Heidi
Here is the queries in that file:
$catquery = "SELECT $wpdb->term_taxonomy.count as 'count',
$wpdb->terms.term_id, $wpdb->terms.name, $wpdb->terms.slug,
$wpdb->term_taxonomy.parent, $wpdb->term_taxonomy.description FROM
$wpdb->terms, $wpdb->term_taxonomy WHERE $wpdb->terms.term_id =
$wpdb->term_taxonomy.term_id AND
$wpdb->term_taxonomy.taxonomy = 'link_category' $inExcludeQuery
$catSortColumn $catSortOrder";
$linkquery="SELECT * FROM $wpdb->links l
inner join $wpdb->term_relationships tr on l.link_id = tr.object_id
inner join $wpdb->term_taxonomy tt on
tt.term_taxonomy_id = tr.term_taxonomy_id
inner join $wpdb->terms t on t.term_id = tt.term_id
WHERE tt.taxonomy='link_category' AND l.link_visible='Y'
$linkSortColumn $linkSortOrder";