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
//add this code to functions.php | |
function bp_remove_allmembers_tab_js_script(){ ?> | |
<script type="text/javascript"> | |
var jq = jQuery; | |
jQuery(document).ready(function (jQuery) { | |
jq('#members-all').removeClass('selected').hide(); | |
jq('#members-personal').find('a').trigger('click'); | |
}); |
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
/** | |
* Add the code to functions.php of your current theme. | |
* this code hide comments for no logged in users | |
*/ | |
add_filter( 'bp_activity_get_comment_count' , 'bp_only_loggedin_can_see_comments', 10,1 ); | |
function bp_only_loggedin_can_see_comments( $count ){ | |
if ( !is_user_logged_in() ) | |
$count = 0; |
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
function get_user_ids_by_role($role){ | |
$users=array(); | |
$founded_users = get_users( array( 'role' => $role ) ); | |
if(!empty($founded_users)){ | |
foreach((array)$founded_users as $user) | |
$users[]=$user->ID; | |
} | |
return $users; | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/** | |
* bp_like_button() | |
* | |
* Outputs the Facebook 'Like/Unlike' . | |
* | |
*/ | |
function bp_like_button( $id = '', $type = '' ) { | |
$activity_permalink = bp_get_activity_thread_permalink(); | |
; | |
?> |
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
add_action( 'after_setup_theme','bp_remove_custom_image_header', 100 ); | |
function bp_remove_custom_image_header() { | |
if ( bp_is_user_activity() || bp_is_activity_component() || bp_is_group_home() ) { | |
//remove_custom_background(); | |
remove_custom_image_header(); | |
} | |
} |
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
add_action( 'bp_legacy_theme_ajax_querystring','bprm_exclude_members',20 , 2 ); | |
add_action( 'bp_ajax_querystring','bprm_exclude_members',20 , 2 ); | |
function bprm_exclude_members( $qs=false, $object = false ){ | |
global $bp; | |
//list of users to exclude | |
//comma separated ids of users whom you want to exclude | |
// for example '0,1,54' |
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 | |
function bp_get_user_domain_with_id( $domain, $user_id, $user_nicename = false, $user_login = false ) { | |
if ( empty( $user_id ) ) | |
return; | |
if( isset($user_nicename) ) | |
$user_nicename = bp_core_get_username($user_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
function bp_get_activities($atts, $content = null ){ | |
extract(shortcode_atts(array( | |
'max' => '10', | |
'per_page' => '10' | |
), $atts)); | |
$activities = '<ul class="activity-list item-list">'; | |
if ( bp_has_activities( 'activity&per_page='. $per_page .'max='. $max ) ) : | |
ob_start(); |
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 | |
function bptt_init() { | |
// ======================================= GROUP FEATURES ================================== | |
// This is inspired by the external-group-blogs BP plugin | |
/** Group blog extension using the BuddyPress group extension API **/ |