Forum Replies Created
-
@henrywright
Oh, ok. And so I would create a line of code (I’m assuming in my bp-custom.php?) for each group that I create and want to block access to? Sounds great!.I’m trying to understand how I accomplish this with the WooCommerce Membership plugin I’m using. Would I use do_shortcode() along with the given parameters for the WooCommerce shortcode? And how would that display on the page? I guess maybe just show the restriction message . . .
Unfortunately, I don’t have time this weekend to play around with this, but I’ll have a go at it some time around Monday, and I’ll be sure to let you know how things go.
THANK YOU SO MUCH for getting back to me. I was starting to get really frustrated with this =)
The URLs to specific groups that would only be accessible by certain subscriptions.
For example, someone with a Artist subscription could access
http://www.mywebsite.com/groups/TheArtGroupsomeone with a Vocalist subscription could access
http://www.mywebsite.com/groups/VocalistsUnitebut the Artist couldn’t access the URL (or see the content) for Vocalists Unite without a Vocalist subscription, and the Vocalist couldn’t access The Art Group without an Artist Subscription.
Am I making sense?
Another Update:
Ok, I was finally able to create a change in the file I was trying to edit. For some reason, I wasn’t able to insert code in the exact place I was trying to last time, but I WAS able to add code elsewhere in the document.
Also, I noticed the name of the hook started with “bp”, so I moved my cover-image code to my bp-custom.php file in my child theme. But it didn’t work there either. I feel like there’s something else I’m supposed to do with
$settings['callback']
. Or maybe I’m supposed to plug some more code in elsewhere. I could really use some help with this.Also, while playing with the profile templates, I noticed there were a few hooks (which I’m learning are the ‘actions’ I’m adding to) that don’t really seem to do anything but sit there. Do they exist only for me to add code to through my bp-custom.php? If so, why wouldn’t I just hard-code something into the template file?
For example:
do_action( 'bp_member_header_actions' );
sits between the @username andlast-activity
. But it’s empty. When the profile page loads, there’s nothing there. So that would make it an empty hook for me to plug stuff into, right?bp_profile_header_meta
is also empty. Are all hooks like that? Or do any of them have their own code/functions?I would still like to know where these actions are declared, and what possible functions lie inside them. Is there any way to find that information out? People create their own BP themes and plugins all the time so there has to be a way to figure this stuff out . . .
UPDATE: I found this topic -> Editing BuddyPress Core Files Within Child theme That suggested that I should have a
buddypress
folder inside my child theme directory, and that all my copied files should go in THERE! I made the change, but I still can’t update any of the actual files. I tried my PIZZA HUT test again, but this time nothing flashed on the screen. So I guess that’s not it?BTW – I’m just going to keep posting updates as I go so that when someone shows up, they’ll have current information on what I’ve tried. Maybe save some time that way.
Side Note:
I dont know if I can/should ask this here, or if it should be a different post, but I’m trying to make changes to the buddypress templates in my child theme, and it seems that I’m not allowed (?!) to make changes to the actual templates?For example, I was trying to make changes to cover-image-header.php just to see if I can. I wanted to add “Last Active:” just before the function that lists when the member was last active. Just to see if I could. When I refreshed the page, I thought I saw for a brief second that it did in fact say “Last Active:”, before it disappeared and just showed the original content again. To make sure it was actually my code and not a glitch, I repeated the process but replaced LAST ACTIVE with PIZZA HUT. Just to make sure it was actually me. Refresh -> Pizza Hut flashed. Yup, it was me. But why wont the code stick? Could it be my child theme document tree isn’t right? Or do I need to add some code somewhere so that changes in my child folder override files in the original buddypress folders?
When I copied my files over, I group selected the folders in
plugins/buddypress/bp-templates/bp-legacy/buddypress
and copied them all over tothemes/my-theme/buddypress
. Am I missing a folder or something?Also: I figured out the concept behind
add_action
tacking on instructions to ado_action
function. But where do theDO_ACTION
functions live? And am I able to modify those? I would like to add some font-awesome icons to the front of my profile menu links the way we have here, but I can’t find the code that spits out the information.