In restrict-widgets.php I added the following code after line 1611:
foreach(get_the_category() as $category)
{
$found_main = isset($instance['rw_opt']['category_'.$category->cat_ID]) ? true : false;
if ($found_main) break;
}
This achieves the functionality I desire. Have I misinterpreted the intention of setting a category restriction? It appears it’s designed to show only on particular category archives, rather than on posts within a particular category.
Note: the above needs to be enclosed in if ($found_main == false)
Yes, exactly.
For that kind (or any other) of restriction just use the rw_display_widget filter hook. It returns a boolean of wheather to disply widget or not.
I don’t like that direction because it’s not intuitive. I’d rather this change be added directly to the plugin itself. Otherwise I’ll just fork it.