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 | |
| /** | |
| * 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 | |
| /** 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 | |
| /* | |
| 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 | |
| /** | |
| * 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 | |
| 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 | |
| /************* 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 | |
| /* | |
| beginning of the code to paste in the functions.php of the active theme (twentyten, twentyeleven or twentytwelve) | |
| If you want to adapt it to your theme, you'll need to check if it uses some body_class to render its layout and eventually | |
| adapt lines 70 to 101. | |
| */ | |
| class Imath_WP_Editor_Template | |
| { | |
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 your active theme */ | |
| function imath_activivity_dont_save( $activity_object ) { | |
| // friendship_created is fired when a member accepts a friend request | |
| // joined_group is fired when a member joins a group. | |
| $exclude = array( 'friendship_created', 'joined_group'); | |
| // if the activity type is empty, it stops BuddyPress BP_Activity_Activity::save() function |
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 your theme ***/ | |
| function imath_wants_you_to_be_in_group_to_comment_group_activities( $can_comment ) { | |
| global $activities_template; | |
| if( !is_super_admin() && $activities_template->activity->component == 'groups' && !groups_is_user_member( bp_loggedin_user_id(), $activities_template->activity->item_id ) ) | |
| $can_comment = false; | |