Skip to content

Instantly share code, notes, and snippets.

View toluaddy's full-sized avatar
💭
I may be slow to respond.

toluaddy

💭
I may be slow to respond.
View GitHub Profile
//Do not notify for join group activity in BP Local group Activity notifier
function buddydev_do_not_notify_join_group_activity( $stop_notification, $activity ) {
if ( $activity->type == 'joined_group' ) {
$stop_notification = true;
}
return $stop_notification;
}
add_filter( 'bp_local_group_notifier_skip_notification', 'buddydev_do_not_notify_join_group_activity', 10, 2 );
<?php
function mb_profile_menu_tabs() {
global $bp;
$bp->bp_nav['groups']['name'] = str_replace( 'Groups', '群', $bp->bp_nav['groups']['name'] );
$bp->bp_nav['friends']['name'] = str_replace( 'Friends', '好友', $bp->bp_nav['friends']['name'] );
$bp->bp_nav['messages']['name'] = str_replace( 'Messages', '信息', $bp->bp_nav['messages']['name'] );
$bp->bp_nav['notifications']['name'] = str_replace( 'Notifications', '通知', $bp->bp_nav['notifications']['name'] );
$bp->bp_nav['forums']['name'] = '论坛';
}
@toluaddy
toluaddy / functions.php
Created February 3, 2020 17:22 — forked from buddycore/functions.php
BuddyPress: Default Group Avatar
function sc_bp_default_group_avatar($avatar) {
global $bp, $groups_template;
if(strpos($avatar,'group-avatars')) :
return $avatar;
else :
@toluaddy
toluaddy / ntwb_bbp_bp_pm.php
Created February 3, 2020 17:14 — forked from ntwb/ntwb_bbp_bp_pm.php
bbPress - Add BuddyPress Private Message link after author reply details
<?php
/*
Plugin Name: bbPress - Add BuddyPress Private Message link after author reply details
Plugin URI: https://gist.github.com/ntwb/9887310
Description: bbPress - Add BuddyPress Private Message link after author reply details
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
<?php /*
--------------------------------------------------------------------------------
Plugin Name: BuddyPress Biography Sync
Description: Keeps a BuddyPress xProfile field in sync with the WordPress user description field.
Author: Christian Wach
Version: 0.1
Author URI: http://haystack.co.uk
--------------------------------------------------------------------------------
*/
@toluaddy
toluaddy / wp-idea-stream-custom.php
Created February 3, 2020 17:11 — forked from imath/wp-idea-stream-custom.php
Add a confirmation prompt to remove link in BuddyPress groups.
<?php
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
function georgio_idea_footer_actions( $footer = '' ) {
if ( ! bp_is_group() ) {
return $footer;
}
@toluaddy
toluaddy / bp-custom.php
Created February 3, 2020 17:05 — forked from imath/bp-custom.php
Edit BuddyPress primary nav so that profile primary item is before the activity primary item
<?php
/**
* BuddyPress 2.6.0 introduced a new nav API
* with a Backcompat mechanism. But accessing/editing
* deprecated globals can lead to such problems...
*
* It's too bad Theme designers forget to test betas :)
*/
function strothi_profile_primary_nav_first() {
$new_group = new BP_Groups_Group;
$new_group->creator_id = 1;
$new_group->name = 'test';
$new_group->slug = 'test';
$new_group->description = 'nothing';
$new_group->news = 'whatever';
$new_group->status = 'public';
$new_group->is_invitation_only = 1;
$new_group->enable_wire = 1;
@toluaddy
toluaddy / conditional_bbpress_style.php
Created February 3, 2020 16:55 — forked from DanielBakovic/conditional_bbpress_style.php
Conditional loadinf of bbPress CSS/JavaScripts
<?php
function conditional_bbpress_styles_scripts() {
// First check that bbpress exists to prevent fatal errors
if ( function_exists( 'is_bbpress' ) ) {
//dequeue scripts and styles
if ( ! is_bbpress() && ! is_buddypress() ) {
wp_dequeue_style('bbp-default');
wp_dequeue_style( 'bbp_private_replies_style');
wp_dequeue_script('bbpress-editor');
}
@toluaddy
toluaddy / jmw_make_edit_default_for_own_bp_profile.php
Created February 3, 2020 16:53 — forked from calliaweb/jmw_make_edit_default_for_own_bp_profile.php
BuddyPress - make edit screen the default for own profile
<?php
add_action( 'bp_setup_nav', 'jmw_make_edit_default_for_own_bp_profile', 15 );
/*
* Edit the buddypress menus
*/
function jmw_make_edit_default_for_own_bp_profile() {
global $bp;
if ( ! bp_is_my_profile() ) {