BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 71

    A text field is giving me results normal.

  • Participant
    Level: Enlightened
    Posts: 71

    I just tried, it didn’t gave me any result either . I’ve even tried to set ‘array’ instead of ‘comma’.

  • Participant
    Level: Enlightened
    Posts: 71

    Hello Ravi,

    Thank you so much for your feedback. You have been a savier for me 🙂

    I have tried to do:

    $data = xprofile_get_field_data( 12, $user_id = 23, 'comma' );
    echo $data;

    but it doesn’t give me any result . Maybe i am doing something wrong?

  • Participant
    Level: Enlightened
    Posts: 71

    Thank you for your help Brajesh 🙂

    This is what i was trying to do.

  • Participant
    Level: Enlightened
    Posts: 71

    Hello Brajesh,

    Thank you for your help 🙂

    I made this:

    add_filter( 'bp_get_the_profile_group_name', 'child_update_profile_group_name' );
    function child_update_profile_group_name( $name ) {
    	global $group;
    	if ( $group->name == 'Settings' && bp_current_user_can( 'subscriber' ) ) {
     		$name = 'Settings1';
    	}
    	return $name;
    }

    since there is no group id available, but still don’t work 🙁

    Any ideas how i can target the group?

  • Participant
    Level: Enlightened
    Posts: 71

    Hello Brajesh,

    Thank you very much for your reply 🙂 \

    Did you manage to push an update on the fix?

    Please let me know 🙂

  • Participant
    Level: Enlightened
    Posts: 71
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 71

    Hello @Ravi,

    You were correct. I spotted my mistake. It’s working now! Thank you for your help!!

  • Participant
    Level: Enlightened
    Posts: 71

    hello @Ravi, after many tests it works perfectly fine with date_recorded < current_date - interval 60 day for getting the users that haven’t been active for more than 2 months.

    Is the if ( empty( $user_ids ) ) { return; } correct as it should be in the code? https://pastebin.com/EfASFZNa

    or should i just make an if ( ! empty( $user_ids ) ) in the foreach ( $user_ids as $user_id ) loop?

    Thank you for your help

  • Participant
    Level: Enlightened
    Posts: 71

    Hello @Ravi,

    The action works correct .

    My only issue is how can i get the text of the active notice in the loop?

    `function important_notification($subject, $message) {
    $notice = BP_Messages_Notice::get_active();
    $notification = ” . bp_message_notice_text($notice) . ”;

    $args = array(
    ‘meta_key’ => ‘_is_featured’
    );

    $members = get_users( $args );
    foreach( $members as $member ) {
    $user_id = $member->ID;
    $member_account = bp_core_get_user_domain( $user_id );

    $first_name = $member->first_name;

    $email_subject = ‘Important information’;

    $note_message = sprintf( ‘Hello %1$s,’ , $first_name ) . “<br><br>”;

    $note_message .= sprintf( ‘We have an important information for you:’ ) .”<br><br>”;
    $note_message .= sprintf( ‘<i>%1$s</i>’ , $notification ) .”<br><br>”;
    $note_message .= sprintf( ‘Please login <a href=”%1$s” target=”_blank”>to your account</a> to remove the information if you want.’ , $member_account ) .”<br><br>”;

    wp_mail( $member->user_email, $email_subject, $note_message );
    }
    }
    add_action( ‘messages_send_notice’, ‘important_notification’, 10, 2 );`

    If i use the `$notice = BP_Messages_Notice::get_active();
    echo ” . bp_message_notice_text($notice) . ”;` in a page i get the text normal. But inside a plugin file it doesn’t work. What am i missing ?

    Thank you for your time and your great support.