This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'groups_create_group', function( $group_id ) { | |
| // Get users of certain roles. | |
| $user_ids = get_users( | |
| array( | |
| 'role' => array( 'subscriber' ), | |
| 'fields' => 'ID', | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Disable Posting form on Profile Page. | |
| */ | |
| function yzc_disable_profile_wall_form( $enable ) { | |
| if ( bp_is_active( 'activity' ) && bp_is_my_profile() ) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add Choose Group Box. | |
| */ | |
| function yzc_add_choose_group_box() { | |
| if ( bp_is_active( 'activity' ) && ! bp_is_activity_directory() ) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Youzify - BuddyPress Disable Posting form on Global Activity Stream. | |
| */ | |
| function yzc_disable_activity_stream_wall_form( $enable ) { | |
| if ( bp_is_active( 'activity' ) && bp_is_activity_directory() ) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Redirect users to login if not not logged, otherwise, redirect to user activity. | |
| */ | |
| function buddydev_custom_user_home_page() { | |
| if ( ! is_user_logged_in() ) { | |
| bp_core_redirect( wp_login_url( site_url( '/' ) ) ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Class MC_BP_Notifications | |
| * Handle the read all notifications without post / get method, based on unread notifications | |
| * | |
| * To be used in HTML : <a href="<?php echo Wide_Notifications::mark_notifications_as_read_url(); ?>">Read all notifications</a> | |
| * | |
| * @author Maxime CULEA | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Allow Ajax on Members types Directory Tab. | |
| */ | |
| function yzc_allow_ajax_on_members_type_tab() { | |
| if ( ! bp_is_members_directory() ) { | |
| return; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Add tree Post Image. | |
| **/ | |
| function yzc_get_custom_post_type_by_blog() { | |
| global $activities_template; | |
| // Get Activity. | |
| $activity = $activities_template->activity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Registers a REST field for the Activity Endpoints. | |
| function example_register_activity_rest_field() { | |
| bp_rest_register_field( | |
| 'activity', // Id of the BuddyPress component the REST field is about | |
| 'example_field', // Used into the REST response/request | |
| array( | |
| 'get_callback' => 'example_get_rest_field_callback', // The function to use to get the value of the REST Field | |
| 'update_callback' => 'example_update_rest_field_callback', // The function to use to update the value of the REST Field |