Skip to content

Instantly share code, notes, and snippets.

Brajesh Singh sbrajesh

Block or report user

Report or block sbrajesh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BP Group Activities Notifier.php
<?php
/**
* Plugin Name: BP Group Activities Notifier
* Plugin URI: http://buddydev.com/plugins/bp-group-activities-notifier/
* Author: Brajesh Singh(BuddyDev)
* Author URI: http://buddydev.com/members/sbrajesh/
* Version: 1.0
* Description: Notifies on any action in the group to all group members. I have tested with group join, group post update, forum post/reply. Sould work with others too
*/
@sbrajesh
sbrajesh / hide-user-on-directory.php
Last active Aug 29, 2015
Hide Logged in user on BuddyPress directory
View hide-user-on-directory.php
add_filter('bp_ajax_querystring', 'devb_hide_user_on_directory', 15, 2);
function devb_hide_user_on_directory( $query_string, $object ){
if( !is_user_logged_in() )
return $query_string;
if( $object != 'members' || isset( $_REQUEST['search_terms'] ) && $_REQUEST['search_terms'] ) //updated to not hide from sarch
return $query_string;
@sbrajesh
sbrajesh / gist:8c6b001dad1983551dac
Created Apr 24, 2015
Friends only default privacy
View gist:8c6b001dad1983551dac
add_filter( 'bpdmp_default_settings', 'bd_friends_only_defult_message_privacy' );
function bd_friends_only_defult_message_privacy( $settings ) {
$settings['privacy_type'] = 'friends_only';
return $settings;
}
@sbrajesh
sbrajesh / gist:088e365ae0b3fb886c43
Created Jul 21, 2015
stop buddyblog featured image
View gist:088e365ae0b3fb886c43
<?php
//do not allow featured image pload
add_filter( 'buddyblog_post_form_settings', 'buddydev_restrict_featured_image_upload' );
function buddydev_restrict_featured_image_upload( $settings ) {
$settings['has_post_thumbnail'] = 0;
return $settings;
}
@sbrajesh
sbrajesh / Community activity as Default
Created Jun 15, 2011
It will make the community activity sub tab as default activity tab on profile
View Community activity as Default
//fix the nav default
function bpcom_fix_nav(){
global $bp;
if(!bp_is_my_profile())
return;
if ( $bp->current_component == BP_ACTIVITY_SLUG && $bp->current_action=="just-me" ) {
$action=bpcom_get_current_actual_action();
@sbrajesh
sbrajesh / Allow to change the background of profile container div
Created Jun 19, 2011
Allow to change the background of profile container div
View Allow to change the background of profile container div
<?php
add_filter("bppg_iwilldo_it_myself","__return_true");//stop the plugin to inject css
//now we can write our own css
add_action("wp_head","my_css_for_profile_bg");
function my_css_for_profile_bg(){
$image_url=bppg_get_image();
if(!$image_url)
@sbrajesh
sbrajesh / css mod for Jeremy
Created Jun 28, 2011
modification of Background css for Jeremy
View css mod for Jeremy
<?php
add_filter("bppg_iwilldo_it_myself","__return_true");//stop the plugin to inject css
//now we can write our own css
add_action("wp_head","my_css_for_profile_bg");
function my_css_for_profile_bg(){
$image_url=bppg_get_image();
if(!$image_url)
@sbrajesh
sbrajesh / redirect to Profile
Created Jul 3, 2011
Redirect to Profile for admin
View redirect to Profile
<?php
/*
Plugin Name: BP Redirect to Profile for Buddypress
Description:Redirect user to their profile when they login
Version: 1.1.1
Requires at least: BuddyPress 1.1
Tested up to: BuddyPress 1.2.8+WordPress 3.1
License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
Author: Brajesh Singh
Author URI: http://buddydev.com
@sbrajesh
sbrajesh / Create activity entry on profile background upload
Created Jul 6, 2011
Create activity entry on profile background upload
View Create activity entry on profile background upload
add_action("bppg_background_uploaded","bppg_record_activity");
function bppg_record_activity( $bg_image ) {
global $bp;
if ( !function_exists( 'bp_activity_add' ) )
return false;
$r = array(
'user_id' => $bp->loggedin_user->id,
'content' =>false ,
'action'=>sprintf("%s changed their profile background",bp_core_get_userlink( $bp->loggedin_user->id )),
You can’t perform that action at this time.