Forum Replies Created
-
In reply to: Registration Process
@henrywright-1
Thanks.In reply to: Adding event to activity streamWhat are you using to create the form for submitting a review?
The review creation process should have a hook.In reply to: How to Get User Profile Data>would it work with BP’s fields
It should.
You can always hard code an ID to find out.In reply to: How to Get User Profile DataIf you mean activity comments…
$bp_location = bp_get_profile_field_data( 'field=Location&user_id=' . bp_get_activity_comment_user_id() ); echo $bp_location;If you mean post comments, I think you need to create a custom comment display.
Example: https://codex.wordpress.org/Function_Reference/wp_list_comments#Comments_Only_With_A_Custom_Comment_DisplayIn reply to: Explanation for recurring coding pattern in BP coreSometimes you want to echo the returned value.
Sometimes you just want the value.In reply to: Private Message Button Label ChangeOpen the plugin file, find the text, replace the text
In reply to: Private Message Button Label Change@henrywright-1
And how would you avoid double buttons due to this call in member-header.php?
do_action( ‘bp_member_header_actions’ );@tayenewm
Use the provided apply_filters:function tweak_button_label ( $args ) { $args[link_text] = 'Something'; return $args; } add_filter( 'bp_get_send_message_button_args', 'tweak_button_label', 1, 1 );In reply to: Hide/restrict access to Private Messaging@henrywright-1
Don’t include the global if you aren’t going to use it.In reply to: Cannot add specific user to a groupDid you try switching to a theme like WP 2012?
Although that won’t explain why the same setup on a different domain works, still it would be a clue.
In reply to: Cannot add specific user to a groupUse Dashboard > Users to see if their Role types are the same.
You should be able to do a conditional based on the page slug, action or uri.
But the user query might fire before that check can be run.
Try a simple echo from a function on that hook, see where/when it appears.You could manipulate the members loop (stuff into array & resort)
but that’s very inefficient unless you have less than 1000 users.
And I’m not sure what effect it would have on pagination – I suspect not good.It would be best to filter this at the query level.
See do_action_ref_array( ‘bp_pre_user_query’, array( &$this ) );
In function prepare_user_ids_query()
In buddypress\bp-core\bp-core-classes.phpIn reply to: Charging for file uploadsYou could use Easy Digital Downloads or Woocommerce.
They both have premium extensions for front-end creation of ‘products’.Both approaches will need customization to handle the credits.
There may be some extension available.Or you’ll have write a full solution.
You’ll need to know the user_id for the teacher.
Then check the array for that id. If it’s found, remove it.
And tell the student why, something like:
bp_core_add_message( __( 'You cannot send a private message to the teacher.', 'buddypress' ), 'error' );Do you know how to use filters?
Take a look at function send() in
\buddypress\bp-messages\bp-messages-classes.phpIt has lots of filters.
I’d use the do_action_ref_arrayThere is a premium plugin that supports blocking on a per member basis:
BuddyBlockIn reply to: buddypress profile new tab returns permission deniedTry these changes:
'parent_url' => $bp->loggedin_user->domain . '/', 'parent_slug' => $bp->profile->slug,In reply to: Buddypress locking a member out of his own groupI’ve had great success using w3totalcache with most everything selected except page caching.
And I always use the memcached option – so you have to have memcache set up across all your servers.
Involves a lot of fiddling – but worth it for installs with tens of thousands of members.
> if I want to create a completely bespoke theme (not theme compat), how do I stop an instance of BP_Legacy being created and registering its actions?
Just guessing here, but perhaps by manipulating ‘register_theme_packages’ in bp-loader.php ?
If you get this working, any info / hints you can share would be appreciated.
In reply to: Buddypress locking a member out of his own groupw3totalcache is a very powerful plugin.
And it’s essential to use a caching plugin on large BP installs.
But don’t use page caching with any plugin or you will get stale pages and other issues.And you’ll have to carefully tune the plugin settings for your particular install and hosting.
It can be quite complicated. But once you get it right, the difference is dramatic.In reply to: Members meta queryFavorites are stored per user in wp_usermeta in a serialized string in meta_value.
If they were stored per activity, what you need would be easy.
You could try: `global $wpdb;
$fav_ids = $wpdb->get_col(
”
SELECT user_id FROM wp_usermeta
WHERE meta_key LIKE ‘bp_favorite_activities’
AND meta_value LIKE ‘%\”900\”%’
”
); `But this approach may return false matches.
https://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Column
In reply to: Members meta querySo you tried: bp_is_groups_component() and bp_is_members_component() ?
Use pastebin to post the code you tried.
In reply to: buddypress profile new tab returns permission deniedTry adding this to the bp_core_new_nav_item array:
'position' => 40, 'user_has_access' => bp_is_my_profile(), 'default_subnav_slug' => 'test'