Skip to content

Instantly share code, notes, and snippets.

View wbcomdev's full-sized avatar

Wbcom Dev wbcomdev

View GitHub Profile
<?php
/**
* Hide Users from BuddyPress Members List by User role.
*
* @param array $args Args.
*
* @return array
*/
function wbcom_hide_members_from_member_lists_by_user_role( $args ) {
<?php
/**
* Hide users from BuddyPress members list.
*
* @param array $args Args.
*
* @return array
*/
function wbcom_exclude_members_from_member_directory_page( $args ) {
<?php
/**
* Sidewide activity stream only for friends.
*
* @param array $args Arguments.
*/
function wbcom_friends_only_activity_args( $args ) {
if ( ! bp_is_activity_directory() || ! is_user_logged_in() || ! empty( $args['scope'] ) ) {
return $args;
<?php
/**
* Sets the size of buddypress profile cover image.
*
* @param int $size size in bytes.
* @param string $type upload type(avatar, cover_upload).
*
* @return float|int
*/
function wbcom_sets_size_of_bp_cover_image( $size, $type ) {
<?php
/**
* Sets the size of buddypress profile avatar.
*
* @param int $size size in bytes.
* @param string $type upload type(avatar, cover_upload).
*
* @return int
*/
function wbcom_sets_size_of_bp_avatar( $size, $type ) {
<?php
/**
* Sets the file types for upload BuddyPress User and Group Cover Image.
*
* @param array $exts extensions.
* @param string $type attachment type.
*
* @return array
*/
function wbcom_set_file_type_for_bp_profile_cover_image( $exts, $type ) {
<?php
/**
* Sets the file types for upload bp profile avatar.
*
* @param array $exts extensions.
* @param string $type attachment type.
*
* @return array
*/
function wbcom_set_file_type_for_bp_profile_avatar( $exts, $type ) {
<?php
/**
* Hide member directory page for specific user roles.
*/
function wbcom_hide_member_directory_page_for_specific_user_role() {
if ( ! bp_is_members_directory() ) {
return;
}
if ( ! is_user_logged_in() ) {
bp_do_404();
<?php
/**
* Add bp profile navigation for create group.
*/
function wbcom_add_bp_profile_tab_for_create_group() {
if ( ! bp_is_my_profile() ) {
return;
}
$slug = bp_get_groups_slug();