Hi all, I initially asked about this issue in the following post: https://commonsinabox.org/groups/help-support/forum/topic/user-roles-and-javascript/ along with another issue. I’ve broken it out for easier ‘findability’ and to untangle my two issues.
The issue is with the Buddypress MPO (more privacy options) plugin installed only public blogs are shown in the Site Directory unless you are a superadmin.
Thank you to Ray for providing the following advice in the other thread:
BuddyPress only displays public sites in the Sites Directory for non-super admins:
https://buddypress.trac.wordpress.org/browser/tags/2.8.2/src/bp-blogs/classes/class-bp-blogs-blog.php?marks=188-189#L163
I had to work around this for another site I work on to modify the wb.public = 1
clause.
I want to provide a little more detail on a complete fix and ask a couple of questions about the safety of this fix.
First, with the MPO plugin active there are five privacy level which are store in the wp_blogs table in the public column with a numerical index as follows:
1 Allow search engines to index this site
0 Discourage search engines from indexing this site
Note: Neither of these options blocks access to your site — it is up to search engines to honor your request.
-1 Visible only to registered users of this network
-2 Visible only to registered users of this site
-3 Visible only to administrators of this site
I wanted to display the top three options above for my users, and as per Ray’s advice modified the wb.public = 1 clause to wb.public >= -1
Question 1: are there privacy options out there with an index higher than 1 that will be captured by my >= operator?
Following the link above (which was a different version than I’m using) and then finding the corresponding spot in the function, I made this change. It worked perfectly, except…
The list tab “All Sites” was still displaying the old tab total. Clearly a similar change needed to be made elsewhere. The class-bp-blogs-blog.php uses the wb.public value in six different places. I’m not sure that I needed to modify all six, but it did solve the problem of the navigation bar total display.
Question 2: Is there any danger of messing something else up by changing all six, should I be more selective.
Question 3: I have been trying to confine my modifications to a child theme and this involves a hack of buddypress plugin files and the changes will need to be made with each BP update. Is there any “child themable” way to deal with this?
Cheers,
t