Forum Replies Created
-
In reply to: GROUP ACTIVITY HOOKS that would be great to have.
This works as expected:
function test_bp_activity_add( $r, $activity_id ) { write_log( $activity_id ); write_log( $r ); } add_action( 'bp_activity_add', 'test_bp_activity_add', 99, 2 ); //do_action( 'bp_activity_add', $r, $activity->id );From the log:
[28-Nov-2019 12:56:39 UTC] 419 [28-Nov-2019 12:56:39 UTC] Array ( [id] => [action] => [content] => Test action hook on Group activity update [component] => groups [type] => activity_update [primary_link] => [user_id] => 1 [item_id] => 1 [secondary_item_id] => [recorded_time] => 2019-11-28 12:56:39 [hide_sitewide] => [is_spam] => [error_type] => bool )So just set a conditional to check if
$r['component'] == groupsand do whatever you want.In reply to: Cannot remove group invitesYou may have found a bug.
You can open a ticket here.In reply to: xprofile_get_field_data not working at pre_get_postsUsing the proper hook always helps. Can be tricky to figure out.
This is not up to date or comprehensive, but should help: bp hook order
In reply to: xprofile_get_field_data not working at pre_get_postsYou should not need to write a custom query to retrieve a piece of profile data, but if you do then this is more distributive:
global $wpdb; $bp = buddypress(); $user_id = get_current_user_id(); $field_id = 2; // for example $field_value = $wpdb->get_var( $wpdb->prepare( "SELECT value FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = $user_id", $field_id ) ); var_dump( $field_value );In reply to: xprofile_get_field_data NOT Working in Child Theme!You are making some basic mistake.
You shouldn’t need to create an instance ofbp
Try using thebp_readyhook instead ofbp_loaded.
Instead of$bp->loggedin_user->idusebp_loggedin_user_id()orget_current_user_id()
You don’t say where you are trying to use it in your child theme.
Why not use pastebin to share the section of code that is not working?
Usevar_dumprather thanechoto see what is really being returned.
Try your code in bp-custom.phpIn reply to: BP_DEFAULT_COMPONENTforumsare handled by bbPress – not BuddyPressIn reply to: Error after WordPress updateApplying a patch requires the use of version control.
You can apply a patch manually by editing each file in the patch, but I don’t recommend it.
The best approach is to wait until the patch is rolled into the next release.
If you have further questions, you can add them to the ticket.In reply to: Error after WordPress updateThis is a known bug and a ticket & patch exist:
https://buddypress.trac.wordpress.org/ticket/8163In reply to: Profile image crop function not workingThanks for the screenshot of the error.
Just before the word ‘Intervention’, there is an arrow. Click it and you should see the whole error message. Copy and paste it in a reply here.You may need to open a ticket.
use the same login you use here. And include all the info you posted here.In reply to: Profile image crop function not workingIt’s probably a javascript conflict with some code in your theme or some other plugin.
Did you check your browser’s console for js errors?
To confirm it is your theme, try momentarily switching to a WP theme like 2018 and see if the error persists.
Are you using a caching plugin or something that minifies javascript?
Try deactivating it or the minify part and see if the error persists.In reply to: Not all of my “All Members” showMember will not appear on the All Members page unless they have logged in at least once since BP was activated.
In reply to: Help with REST APIafaik, the BP REST API does not use or require keys. Neither does the WP REST API.
Perhaps your mobile app developer was referring to oAuth?
If so, that implementation will be specific to your site, and is not a BP question.In reply to: members not showing on the members pageCreate a member. Then log-in as that member. Do they appear on the Members page?
Members need to login at least once before they appear.In reply to: User Blogs from Front EndBuddyDev is a great and trusted resource for plugins and code snippets for BuddyPress.
In reply to: Name in profileYou need to adjust the proper template.
But don’t edit the templates in the plugin or your changes will be wiped out when you update BP.
Instead, overload the template:Re RED: you didn’t say which template pack you are using. I will assume it is Nouveau.
Over load this template:
wp-content\plugins\buddypress\bp-templates\bp-nouveau\buddypress\members\single\member-header.php
Then open the overload template and find this code near the top:<?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?> <h2 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h2> <?php endif; ?>And simply remove the conditional, so it will look like this:
<h2 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h2>Your other questions are more complex, but will require the same approach:
-
– identify the template(s) you need to change
– overload them
– make your changesIn reply to: Uncaught Error: Class ‘BP_Component’ not foundsubscriptions-tab.phpis a custom file in your child theme, correct?The obvious guess is that there is a problem with the code in that file.
Unless you share that code, it is difficult to know what the problem is.
Please do not post the code here.
Use a site like pastbin to share your code and then post the url here.In reply to: Sorry, the content area was not found in your page.Your issue is specific Elementor. Did you ask them?
Please note that you cannot use a page builder on pages that you have assigned to BP components like Members, Groups, etc.
In reply to: Where to find custom codeDid you read this:
You’ll need to create the
bp-custom.phpfile and then upload it to your site as explained in the article.To upload it, use a FTP tool like Filezilla or if your hosting company provides a File Manager, use that. So ask your hosting provider how to upload files.
In reply to: xprofile_get_field_data not working at pre_get_postsDue to something in your theme, you are calling
xprofile_get_field_datatoo early.In your
pre_get_postsfilter, you could try calling BP:$bp = buddypress();Otherwise, you’ll need to talk to the theme creator.
In reply to: Link to administration in menuRather than create a link for certain roles, just add a redirect for anyone who has a role not approved for access to wp-admin. There are lots of examples of this, google it.
For example, this will send everyone, other than admins, to the home page if they try to visits wp-admin:
function beatwell_block_users_backend() { if ( is_admin() && ! is_super_admin() && ! wp_doing_ajax() ) { wp_redirect( home_url() ); exit; } } add_action( 'init', 'beatwell_block_users_backend' );In reply to: Group menu not showingTry switching momentarily to a WP theme like 2019 and see if the issues persist.
If not, then ask the ‘someone else’ what they did re BP and/or Avada.In reply to: Table doesn’t exist errorThe errors are related to Memberium.
for example: BP_Groups_for_MemberiumAutoJoin
You should talk to Memberium about this issue.
In reply to: Error 2019The error is in your theme, not in the BuddyPress plugin.
Your theme, jannah_v3.2.0, contains some BuddyPress files.
/home/banoyeir/domains/mysite.com/public_html/wp-content/themes/jannah_v3.2.0/jannah/framework/plugins/class-tielabs-buddypress.phpYou need to show the error to the creators of your theme.
In reply to: Member Loop only MemberPress membersTry removing the
ARRAY_N.Instead of
$wpdb->get_resultstry$wpdb->get_colwhich should return a one dimensional array of ids.https://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Column
In reply to: Member Loop only MemberPress membersYou can pass a string of ids to the
excludeparameter ofbp_has_members.How you gather the ids of the members you want to exclude is up to you.
Perhaps MemberPress has a function for getting all the user ids with a membership.
If so, then use theincludeparameter instead.<?php // gather the ids of the members you want to exclude. // for example, say you end up with an array of user_ids: $exclude_these_users = array( 3, 7 ); $exclude_string = '&exclude=' . implode (", ", $exclude_these_users); ?> <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) . $exclude_string ) ) : ?>