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 | |
/************* beginning of the code to paste in the functions.php of the active theme *************/ | |
/* | |
the function to to display only the users that actually uploaded an avatar | |
see http://buddypress.org/support/topic/display-only-members-who-have-uploaded-avatar/ | |
*/ | |
function evo_list_uploaded_avatars(){ |
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 no_revions_for_posts() { | |
// see https://twitter.com/pixenjoy/status/311512790760308736 | |
remove_post_type_support('post', 'revisions'); | |
} | |
add_action( 'init', 'no_revions_for_posts', 99 ); | |
?> |
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 | |
/** | |
* 1- Extending WP_Widget | |
* | |
* Make sure to prefix your class with BPMH_ | |
* and to add a classname prefixed by bpmh- | |
* | |
*/ | |
class BPMH_Widget_Custom extends WP_Widget { |
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 | |
/* | |
Restricting content to the user_id | |
Requires BuddyPress 1.7 & Bowe Codes 2.0.1 | |
*/ | |
class Restrict_Content_User_Shortcode{ | |
function __construct() { | |
$this->setup_filters(); | |
} |
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 | |
/** begining of code to copy paste in functions.php of active theme **/ | |
/** | |
* Forces the order of bc_members to be alphabetical if an alpha class has been added | |
* | |
* Using the class argument of bc_members allows to only filter the members_args | |
* if the class 'alpha' prepends my_members class. Keeping my_members class will maintain | |
* css rules. |
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 | |
/** | |
* Building a new BuddyPress shortcode | |
* using Bowe Codes built-in "API" | |
* | |
* You'll need Bowe Codes : http://wordpress.org/plugins/bowe-codes/ | |
* And BuddyPress 1.7+ | |
*/ | |
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 | |
/* you can copy & paste from here */ | |
//it's important to check the BP_Group_Extension is available | |
if( class_exists( 'BP_Group_Extension' ) ) : | |
/** | |
* This is a quick and dirty class to illustrate "bpgmq" | |
* bpgmq stands for BuddyPress Group Meta Query... | |
* The goal is to store a groupmeta in order to let the community administrator |
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 | |
/** | |
* Script to copy in your activated theme functions.php for instance | |
* Make sure BuddyPress and Events Manager are activated on your blog before using this trick | |
*/ | |
// beginning of the code to copy paste | |
function imath_displays_confirmed_attendees( $output = '', $object = false, $target = '' ) { |
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 | |
/** | |
Seulement visible pour les utilisateurs connectés | |
Portion de code à mettre dans bp-custom.php | |
Voir le codex: http://codex.buddypress.org/plugindev/bp-custom-php/ | |
**/ | |
function check_is_user_logged_in() { | |
if ( ! is_buddypress() ) | |
return; |
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 | |
/** | |
* Il y a effectivement un problème avec l'utilisation de bp_member_profile_data() | |
* dans le Members loop @see https://buddypress.trac.wordpress.org/ticket/4891 | |
* | |
* J'avais indiqué un moyen de contournement sur le forum de BuddyPress.org | |
* @see http://buddypress.org/support/topic/possible-bug-with-bp_member_profile_data-and-date-selector/ | |
* | |
* Dans le cas présent, je pense qu'il est de toute façon plus judicieux d'utiliser xprofile_get_field_data | |
* tout en désactivant réactivant le filtre xprofile_filter_format_field_value_by_field_id pour disposer de la |