This file contains 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
add_action('bp_ajax_querystring','bpdev_exclude_users',20,2); | |
function bpdev_exclude_users($qs=false,$object=false){ | |
//list of users to exclude | |
if($object!='members')//hide for members only | |
return $qs; | |
$excluded_user=join(',',bpdev_get_subscriber_user_ids());//comma separated ids of users whom you want to exclude | |
This file contains 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('bp_blogs_get_blogs','bpdev_exclude_blogs',20,2); | |
function bpdev_exclude_blogs($blogs_details=false,$params){ | |
//list of users to exclude | |
$blogs=array(); | |
$excluded_blogs=array(1,3);//comma separated ids of blogs whom you want to exclude | |
$selected_blogs=$blogs_details['blogs']; |
This file contains 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('personal_options','bpdev_show_info_on_profile_edit_page'); | |
function bpdev_show_info_on_profile_edit_page($user){ | |
$user_id=$user->ID; | |
//repeat the below line for each of the field you want to list | |
//replace the field name with the xprofile field name e.g Name, About etc | |
?> | |
<tr><th>Field Name</th><td><?php echo xprofile_get_field_data('Field Name',$user_id);?></td></tr> |
This file contains 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( 'comment_post', 'bpdev_record_comment_on_main_site', 20, 2 ); | |
add_action( 'edit_comment', 'bpdev_record_comment_on_main_site', 20 ); | |
function bpdev_record_comment_on_main_site($comment_id, $is_approved = true ) { | |
global $bp, $wpdb; | |
$blog_id = (int)$wpdb->blogid; |
This file contains 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
add_action('save_post','bpdev_record_post_on_main_site',20,2); | |
function bpdev_record_post_on_main_site($post_id, $post, $user_id = 0 ) { | |
global $bp, $wpdb; | |
$post_id = (int)$post_id; | |
$blog_id = (int)$wpdb->blogid; | |
if($blog_id==1) | |
return;//it is recording main site and we don't have to worry about it | |
switch_to_blog(1);//switch to main site |
This file contains 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
--- /var/www/bp/1.5/332test/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js | |
+++ /var/www/bp/1.5/332test/2933923/global.js | |
@@ -256,12 +256,16 @@ | |
jq.cookie('bp-activity-oldestpage', 1, {path: '/'} ); | |
var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1; | |
- | |
+ var search_terms=jq("#search-terms").val(); | |
+ search_terms=search_terms?search_terms:''; | |
+ |
This file contains 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
diff --git a/bp-themes/bp-default/_inc/global.js b/bp-themes/bp-default/_inc/global.js | |
index 9efbd71..fa8ecc8 100644 | |
--- a/bp-themes/bp-default/_inc/global.js | |
+++ b/bp-themes/bp-default/_inc/global.js | |
@@ -1261,7 +1261,7 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e | |
search_terms = jq.query.get('s'); | |
if ( null == scope ) | |
- scope = 'all'; | |
+ scope = 'personal'; |
This file contains 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
function remove_wp_adminbar_search_menu(){ | |
//remove the search from from adminbar menu | |
remove_action('admin_bar_menu', 'wp_admin_bar_search_menu', 4 ); | |
} | |
add_action('init','remove_wp_adminbar_search_menu'); | |
function custom_admin_bar_search_menu( $wp_admin_bar ) { | |
if ( is_admin() ) | |
return; |
This file contains 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
add_filter('get_user_metadata','fbplus_filter_wpfb_id',10,4); | |
function fbplus_filter_wpfb_id($val, $object_id, $meta_key, $single){ | |
if($meta_key!='fb_account_id') | |
return $val; | |
//if meta key is fb_account_id, we will need to fetchand see if there exists a facebook_uid | |
$val=get_user_meta($object_id,'facebook_uid',$single); | |
if(empty($val)) | |
$val=null; | |
This file contains 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
add_action('init', 'bdev_fix_activity_posting_hooks'); | |
function bdev_fix_activity_posting_hooks() { | |
remove_action('wp_ajax_post_update', 'bp_dtheme_post_update'); | |
} | |
//add our own handler for activity posting | |
add_action('wp_ajax_post_update', 'bp_mytheme_post_update'); |