Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 551 through 575 (of 3,820 total)
  • @shanebp

    Moderator

    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'] == groups and do whatever you want.

    @shanebp

    Moderator

    You may have found a bug.
    You can open a ticket here.

    @shanebp

    Moderator

    Using 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

    @shanebp

    Moderator

    You 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 );

    @shanebp

    Moderator

    You are making some basic mistake.
    You shouldn’t need to create an instance of bp
    Try using the bp_ready hook instead of bp_loaded.
    Instead of $bp->loggedin_user->id use bp_loggedin_user_id() or get_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?
    Use var_dump rather than echo to see what is really being returned.
    Try your code in bp-custom.php

    In reply to: BP_DEFAULT_COMPONENT

    @shanebp

    Moderator

    forums are handled by bbPress – not BuddyPress

    @shanebp

    Moderator

    Applying 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.

    @shanebp

    Moderator

    This is a known bug and a ticket & patch exist:
    https://buddypress.trac.wordpress.org/ticket/8163

    @shanebp

    Moderator

    Thanks 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.

    @shanebp

    Moderator

    It’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.

    @shanebp

    Moderator

    Member 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 API

    @shanebp

    Moderator

    afaik, 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.

    @shanebp

    Moderator

    Create 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.

    @shanebp

    Moderator

    BuddyDev is a great and trusted resource for plugins and code snippets for BuddyPress.

    In reply to: Name in profile

    @shanebp

    Moderator

    You 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:

    Theme Compatibility & Template Files

    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 changes

    @shanebp

    Moderator

    subscriptions-tab.php is 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.

    @shanebp

    Moderator

    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.

    @shanebp

    Moderator

    Did you read this:

    bp-custom.php

    You’ll need to create the bp-custom.php file 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.

    @shanebp

    Moderator

    Due to something in your theme, you are calling xprofile_get_field_data too early.

    In your pre_get_posts filter, you could try calling BP: $bp = buddypress();

    Otherwise, you’ll need to talk to the theme creator.

    @shanebp

    Moderator

    Rather 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 showing

    @shanebp

    Moderator

    Try 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.

    @shanebp

    Moderator

    The errors are related to Memberium.

    for example: BP_Groups_for_MemberiumAutoJoin

    You should talk to Memberium about this issue.

    In reply to: Error 2019

    @shanebp

    Moderator

    The 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.php

    You need to show the error to the creators of your theme.

    @shanebp

    Moderator

    Try removing the ARRAY_N.

    Instead of $wpdb->get_results try $wpdb->get_col which should return a one dimensional array of ids.

    https://codex.wordpress.org/Class_Reference/wpdb#SELECT_a_Column

    @shanebp

    Moderator

    You can pass a string of ids to the exclude parameter of bp_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 the include parameter 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 ) ) : ?>
Viewing 25 replies - 551 through 575 (of 3,820 total)
Skip to toolbar