Search Results for 'notification user id'
-
Search Results
-
Topic: Notifications page
I have a problem with the notifications page, because when you are in the user’s profile, and you want to see your notifications, the page is not shown, a page error appears, because it does not exist.
https://tudominio.com/miembros/horacios/notifications/
BuddyPress Versión 12.2.0I don’t have any idea how fix it.
The Codex mentions here that there is a page in Settings > Email but I don’t see it.
So I have 2 questions : by default, does sending a notice as an admin to all users triggers a mail to be sent?
And if so where do I configure/disable it? With 40000 users I’d like to be able to notify users but not send a load of email spam.
Topic: Mass-PM users
Topic: Visibility control
I have created a new menu called DATA, then when I visit my profile, my MENU appears (DATA, MESSAGES, NOTIFICATIONS, SETTINGS, ALERT) but I don’t know how to hide my new menu called DATA, for the following options:
(a) when I visit a new user profile.
b) when other users visit my profile.Do you know what kind of functions I can use and what files I have to change in BuddyPRess?
I want to disable the notification email that is sent to the admin whenever a user changes his password, which is triggered by: wp_password_change_notification( WP_User $user ).
I have tried the solutions mentions on https://developer.wordpress.org/reference/functions/wp_password_change_notification/ but none of them worked
Any idea on how to stop these emails?My WordPress version is: 6.2
BuddyBoss ThemeVersion: 2.2.4Heads up ! BP is currently not compatible with PHP 8.2
Deprecated: Creation of dynamic property BP_Members_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Members_Component::$table_name_invitations is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Members_Component::$table_name_last_activity is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Members_Component::$table_name_optouts is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Members_Component::$table_name_signups is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Members_Component::$nav is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-component.php on line 213 Deprecated: Creation of dynamic property BP_Members_Component::$invitations is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-component.php on line 232 Deprecated: Creation of dynamic property BP_XProfile_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_XProfile_Component::$table_name_data is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_XProfile_Component::$table_name_groups is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_XProfile_Component::$table_name_fields is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_XProfile_Component::$table_name_meta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Activity_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Activity_Component::$table_name is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Activity_Component::$table_name_meta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Friends_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Friends_Component::$table_name is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Friends_Component::$table_name_meta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Groups_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Groups_Component::$table_name is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Groups_Component::$table_name_members is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Groups_Component::$table_name_groupmeta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Messages_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Messages_Component::$table_name_notices is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Messages_Component::$table_name_messages is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Messages_Component::$table_name_recipients is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Messages_Component::$table_name_meta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Notifications_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Notifications_Component::$table_name is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Notifications_Component::$table_name_meta is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 718 Deprecated: Creation of dynamic property BP_Settings_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Course_Component::$directory_title is deprecated in wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php on line 299 Deprecated: Creation of dynamic property BP_Activity_Component::$actions is deprecated in wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php on line 350 Deprecated: Creation of dynamic property MemberTypes_Custom_Field::$bp_get_member_type_tax_name is deprecated in wp-content/plugins/vibebp/includes/class.membertypes.from.fields.php on line 29 Deprecated: Creation of dynamic property BP_Members_Admin::$capability is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 109 Deprecated: Creation of dynamic property BP_Members_Admin::$user_profile is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 115 Deprecated: Creation of dynamic property BP_Members_Admin::$current_user_id is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 118 Deprecated: Creation of dynamic property BP_Members_Admin::$user_id is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 121 Deprecated: Creation of dynamic property BP_Members_Admin::$is_self_profile is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 124 Deprecated: Creation of dynamic property BP_Members_Admin::$screen_id is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 127 Deprecated: Creation of dynamic property BP_Members_Admin::$stats_metabox is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 130 Deprecated: Creation of dynamic property BP_Members_Admin::$edit_profile_args is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 133 Deprecated: Creation of dynamic property BP_Members_Admin::$edit_profile_url is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 134 Deprecated: Creation of dynamic property BP_Members_Admin::$edit_url is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 135 Deprecated: Creation of dynamic property BP_Members_Admin::$users_page is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 138 Deprecated: Creation of dynamic property BP_Members_Admin::$signups_page is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 139 Deprecated: Creation of dynamic property BP_Members_Admin::$users_url is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 140 Deprecated: Creation of dynamic property BP_Members_Admin::$users_screen is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 141 Deprecated: Creation of dynamic property BP_Members_Admin::$members_invites_page is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 143 Deprecated: Creation of dynamic property BP_Members_Admin::$subsite_activated is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 146 Deprecated: Creation of dynamic property BP_Members_Admin::$tools_parent is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 160 Deprecated: Creation of dynamic property BP_Members_Component::$admin is deprecated in wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php on line 78 Deprecated: Creation of dynamic property BP_XProfile_Component::$admin is deprecated in wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-user-admin.php on line 38
Hello,
I am trying to create my own notification, but it is not working.
The notification should not be for the author of the post, but for whoever is assigned as client “_sliced_client”, which is stored in the postmeta table in the database and returns the client id.
Wordpress version: 6.1.1
BuddyPress version: 10.6.0<?php // this is to add a fake component to BuddyPress. A registered component is needed to add notifications function custom_filter_notifications_get_registered_components( $component_names = array() ) { // Force $component_names to be an array if ( ! is_array( $component_names ) ) { $component_names = array(); } // Add 'custom' component to registered components array array_push( $component_names, 'propre' ); // Return component's with 'custom' appended return $component_names; } add_filter( 'bp_notifications_get_registered_components', 'custom_filter_notifications_get_registered_components' ); // this gets the saved item id, compiles some data and then displays the notification function custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { // New custom notifications if ( 'propre_action' === $action ) { $post = get_post( $item_id ); // $custom_title = $post->post_author . ' add a quote for you' . get_the_title( $item_id ); $custom_link = get_permalink( $post ); $custom_text = $post->post_author . ' add a quote for you ' . get_the_title( $item_id ); // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'propre_filter', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'propre_filter', array( 'text' => $custom_text, 'link' => $custom_link ), $custom_link, (int) $total_items, $custom_text, $custom_title ); } return $return; } } add_filter( 'bp_notifications_get_notifications_for_user', 'custom_format_buddypress_notifications', 10, 5 ); // this hooks to post creation and saves the post id function bp_custom_add_notification( $post_id, $post ) { if ( $post->post_type == 'sliced_quote' ) { $post = get_post( $post_id ); $client_id= get_post_meta($post_id, '_sliced_client'); $author_id = $post->post_author; bp_notifications_add_notification( array( 'user_id' => $client_id, 'item_id' => $post_id, 'component_name' => 'propre', 'component_action' => 'propre_action', 'date_notified' => bp_core_current_time(), 'is_new' => 1, ) ); } } add_action( 'wp_insert_post', 'bp_custom_add_notification', 99, 2 );
Any ideas?
Thank you very much!
Regards and happy new year!Topic: Missing from BuddyPress
Full hijack the authentication flow (Login/Logout/Register/Forgot/Wrong/All Other): End user should never land on a WP login page. I have a mix of BP, bbp, and WP login pages depending on how the user interacts.
reCAPTCHA during Registration: Should be core. Had to get the plugin from WBCom Designs
Extended Profile Fields: Should be core. Had to get the plugin from BuddyDev
User Menu: Username and Avatar. Conditional menu items. I had to use the “User Menus” plugin by Code Atlantic
Use the username as display name: Had to code this myself.
Disable Full Name field: Custom code again.
Set default notification preferences: More code.
Remove specific accounts from public member list: Really want to hide the admin! More code.
Remove tabs from user profile: More code.
Redirect WP Author to BP Profile: teh codez.
Hi,
I have a custom email notification with a custom action (based on this article – https://codex.buddypress.org/emails/custom-emails/ ), and it’s working, but it doesn’t currently allow the user to subscribe to or unsubscribe from the custom email nortification.
I would like to add this custom notification as an option in the email notification settings form in the member profile, and I would then want to use those settings in the send-function of the email.
I’ve been searching the web and forums forever and couldn’t find much helpful information about how to achieve this.
It seems there is a registration mechanism, as there are plugins that offer to override user preferences, and there are functions that sound like they have something to do with this mechanism, like – bp_nouveau_member_email_notice_settings(). But I couldn’t find any document that actually helped me register the custom email notification or explain how to access that information prior to sending the mail.
Maybe someone here can help? Thanks a lot for any idea!
Hi! I’m trying to set up a network with a twist and I’d really appreciate any pointers 🙂
I want everything anyone posts/comments/stars/etc on the site to remain invisible at first. I’m still on the fence between:
1) User interactions all become visible X hours after they were initially posted or
2) User interactions all become visible at the next 8AM localtime that’s at least X hours after the initial post.I’m not sure how to implement this thoroughly. My first though was to add child template modifications that check the timestamp and only display the content after the cutoff for each loop, but would this be massively inefficient? And how would I ensure that all email notifications about posts are delayed, but without delaying ALL emails so that password resets and other admin stuff still goes through instantly?
I hope this makes some sense, and thank you for any ideas or pointers!!!
Luca
Hello,
We’ve set up a forum with moderation on all new users on our website. We would now want to change the email recipient of the notification that is sent to all admins when someone ask to register to the forums. Is it possible to setup only one email address for this?
Can someone help us on how to do so? We did not find any way to change this in the emails settings.
Maybe we need to add a code snippet in our child theme’s functions.php file?
Please advise.
Thank you,
Francis
Hello,
We’re having an issue with users being automatically allowed in forums if an already approved member invited them.
Besides removing the invitation link from the notification email, is there another solution to avoid these users from being automatically approved when registering using the custom registration link?
Our actual configuration is to disallow everyone from registering in WP General settings, and then checking invitations and membership requests in the Buddypress Options Settings.
Thank you for your help,
Frank
Good afternoon. I have my own small community based on buddypress and bbpress. I want to add a push notification feature to my community. That is, I want users to be able to receive not only messages by mail from buddypress, but also push notifications, but I can not find a free and updated plugin. All the plugins that I find on the Internet have either not been updated for a long time, or do not have Russian language support, or they are paid and require api keys of external services. Could you please suggest me some good and free push notification plugin? Thanks.
I’m trying to get groups_join_group to work when submitting a gravity form to create a user. All other fields are attached but they are not joining the group. This worked in 9.0
Issue:
// Create a new user $new_user_id = wp_insert_user( $userdata ); // GFCommon::log_debug( __METHOD__ . '(): form => ' . print_r( $birthdate, true ) ); if ( ! is_wp_error( $new_user_id ) ) { groups_join_group( $group_id, $new_user_id );
Full code:
add_action( 'gform_after_submission', 'add_member_gform_handle', 10, 2 ); function add_member_gform_handle( $entry, $form ) { if ( $form['title'] === 'Add Member' ) { $fields = $form['fields']; $first_name = rgar( $entry, '1' ); $last_name = rgar( $entry, '2' ); $login = rgar( $entry, '3' ); $password = rgar( $entry, '4' ); $email = rgar( $entry, '5' ); $group_id = rgar( $entry, '6' ); $role = rgar( $entry, '11' ); $notification = rgar( $entry, '9.1' ); $birthdate = rgar( $entry, '10' ); $userdata = array( 'user_login' => $login, 'user_pass' => $password, ); if ( ! empty( $first_name ) ) { $userdata['first_name'] = $first_name; } if ( ! empty( $last_name ) ) { $userdata['last_name'] = $last_name; } if ( ! empty( $email ) ) { $userdata['user_email'] = $email; } if ( ! empty( $role ) ) { $userdata['role'] = $role; } // Create a new user $new_user_id = wp_insert_user( $userdata ); // GFCommon::log_debug( __METHOD__ . '(): form => ' . print_r( $birthdate, true ) ); if ( ! is_wp_error( $new_user_id ) ) { groups_join_group( $group_id, $new_user_id ); // Make the user displayed as a staff on a clubhouse page if ( ! empty( $notification ) ) { tml_send_new_user_notifications( $new_user_id, 'both' ); } if ( ! empty( $birthdate ) ) { $date = DateTime::createFromFormat('Y-m-d', $birthdate); $date = $date->format('Ymd'); update_field('user_birthdate', $date, 'user_' . $new_user_id); } } // Delete form entry // GFAPI::delete_entry( $entry['id'] ); } }
I use gravity forms to create a new user from a groups tab and assign them to a group, based on the group that the group admin is adding them from. This was working just fine in BuddyPress version 8.0 but since upgrading to 10 it is no longer working. What am I missing?
/** * Add member form handler. This form is currently located under the Group Information tab */ add_action( 'gform_after_submission', 'add_member_gform_handle', 10, 2 ); function add_member_gform_handle( $entry, $form ) { if ( $form['title'] === 'Add Member' ) { $fields = $form['fields']; $first_name = rgar( $entry, '1' ); $last_name = rgar( $entry, '2' ); $login = rgar( $entry, '3' ); $password = rgar( $entry, '4' ); $email = rgar( $entry, '5' ); $group_id = rgar( $entry, '6' ); $role = rgar( $entry, '11' ); $notification = rgar( $entry, '9.1' ); $birthdate = rgar( $entry, '10' ); $userdata = array( 'user_login' => $login, 'user_pass' => $password, ); if ( ! empty( $first_name ) ) { $userdata['first_name'] = $first_name; } if ( ! empty( $last_name ) ) { $userdata['last_name'] = $last_name; } if ( ! empty( $email ) ) { $userdata['user_email'] = $email; } if ( ! empty( $role ) ) { $userdata['role'] = $role; } // Create a new user $new_user_id = wp_insert_user( $userdata ); // GFCommon::log_debug( __METHOD__ . '(): form => ' . print_r( $birthdate, true ) ); if ( ! is_wp_error( $new_user_id ) ) { groups_join_group( $group_id, $new_user_id ); // Make the user displayed as a staff on a clubhouse page if ( $role === 'staff' ) { $group_ids = groups_get_user_groups( $new_user_id ); $group = groups_get_group( array( 'group_id' => $group_ids['groups'][0]) ); $group_id = $group->id; groups_promote_member( $new_user_id, $group_id, 'admin' ); } else { groups_demote_member( $new_user_id, $group_id ); } if ( ! empty( $notification ) ) { tml_send_new_user_notifications( $new_user_id, 'both' ); } if ( ! empty( $birthdate ) ) { $date = DateTime::createFromFormat('Y-m-d', $birthdate); $date = $date->format('Ymd'); update_field('user_birthdate', $date, 'user_' . $new_user_id); } } // Delete form entry // GFAPI::delete_entry( $entry['id'] ); } } /** * Add Member form validation */ add_filter( "gform_validation_$clubnet_add_member_form_id", 'add_member_form_validation' ); function add_member_form_validation( $validation_result ) { $form = $validation_result['form']; $login = rgpost( 'input_3' ); $email = rgpost( 'input_5' ); $send_notificaton = rgpost( 'input_9_1' ); if ( ! empty( $login ) && get_user_by( 'login', $login ) ) { $validation_result['is_valid'] = false; //finding Field with ID and marking it as failed validation foreach( $form['fields'] as &$field ) { if ( $field->id == '3' ) { $field->failed_validation = true; $field->validation_message = 'The user with this login already exists.'; break; } } // foreach } if ( ! empty( $email ) && get_user_by( 'email', $email ) ) { $validation_result['is_valid'] = false; //finding Field with ID and marking it as failed validation foreach( $form['fields'] as &$field ) { if ( $field->id == '5' ) { $field->failed_validation = true; $field->validation_message = 'The user with this email already exists.'; break; } } // foreach } // GFCommon::log_debug( 'VALIDATION' . __METHOD__ . '(): form => ' . print_r( 'Empty', true ) ); // Email is required if we requested to send a email about user's account if ( ! empty( $send_notificaton ) && empty( $email ) ) { $validation_result['is_valid'] = false; //finding Field with ID and marking it as failed validation foreach( $form['fields'] as &$field ) { if ( $field->id == '5' ) { $field->failed_validation = true; $field->validation_message = 'Email is required since you requested to send an email.'; break; } } // foreach } //Assign modified $form object back to the validation result $validation_result['form'] = $form; return $validation_result; } /** * Role field */ add_action( 'init', 'clubnet_add_role_field' ); function clubnet_add_role_field( $form ) { global $wp_roles; global $clubnet_add_member_form_id; $all_roles = $wp_roles->roles; // $editable_roles = apply_filters('editable_roles', $all_roles); // $roles_to_skip = array( 'administrator' ); $editable_roles = $all_roles; $roles_to_display = array( 'mentor', 'member', 'youth_leader', 'alumni', 'staff' ); $choices = array(); foreach ( $editable_roles as $role => $role_data ) { if ( ! in_array( $role, $roles_to_display ) ) { continue; } $choice = array( 'text' => $role_data['name'], 'value' => $role ); array_push( $choices, $choice ); } // Reorder to make member role first usort( $choices, function( $choice ) { if ( $choice['text'] === 'Member' ) { return -1; } return 1; } ); $form = GFAPI::get_form( $clubnet_add_member_form_id ); if ( ! $form ) { return; } $label = 'User Role'; $field_idx = -1; $field_id = -1; foreach ($form['fields'] as $idx => $field) { if ( $field->label === $label ) { $field_idx = $idx; $field_id = $field->id; } } if ( $field_idx === -1 ) { $field_id = GFFormsModel::get_next_field_id( $form['fields'] ); } $props = array( 'id' => $field_id, 'label' => $label, 'type' => 'select', 'choices' => $choices, ); if ( $field_idx === -1 ) { $field = GF_Fields::create( $props ); $form['fields'][] = $field; GFAPI::update_form( $form ); } else if ( $form['fields'][$field_idx]->choices !== $choices ) { $field = GF_Fields::create( $props ); $form['fields'][$field_idx] = $field; GFAPI::update_form( $form ); } }