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 | |
/** | |
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 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 |
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 | |
/** | |
* Override BuddyDrive default css by filtering buddydrive_global_css | |
* | |
* The array to return needs to be like : | |
* | |
* array( | |
* 'stylesheet_uri' => url to the new css file | |
* 'deps' => array of registered css dependencies | |
* ) |
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 | |
function restrict_to_a_role() { | |
if ( ! bp_is_user() || buddydrive_get_slug() != bp_current_component() ) { | |
return; | |
} | |
// Change 'bp_moderate' with the capability of your choice | |
if ( ! bp_current_user_can( 'bp_moderate' ) ) { | |
// Remove actions |
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 | |
/** | |
* WP Idea Stream Custom. | |
* | |
* Place here the function to customize Version 2.0+ of WP Idea Stream | |
*/ | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) exit; |
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 | |
/** | |
* Name me as wp-idea-stream-custom.php | |
* and put me in /wp-content/plugins/ | |
*/ | |
function qobalt_remove_hashbuddy_filter() { | |
if ( ! wp_idea_stream_is_single_idea() ) { | |
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
<?php | |
/** | |
* This is temparary, please advise the plugin author to use the BP_Component Class | |
* @see https://github.com/boonebgorges/buddypress-skeleton-component/blob/1.7/includes/bp-example-loader.php | |
*/ | |
function buddypress_links_temporary_fix( $retval, $component = '' ) { | |
if ( 'links' != $component ) { |
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 | |
/** | |
* Using BuddyPress Member types API | |
* | |
* see codex: https://codex.buddypress.org/developer/member-types/ | |
* | |
* Required config: | |
* - WordPress 4.1 | |
* - BuddyPress 2.2 | |
* |
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 | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* Replace the author avatar by the first image found in the idea content | |
* if no image was found keep the avatar. | |
*/ | |
function first_idea_image_as_avatar( $avatar_link, $author, $avatar, $idea ) { | |
if ( empty( $idea->post_content ) ) { |
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 | |
// Exit if accessed directly | |
defined( 'ABSPATH' ) || exit; | |
/** | |
* This will only get the displayed group's menu items | |
* 1/ if a group is displayed | |
* 2/ if the theme is containing the template 'buddypress/groups/single/home.php' | |
* 3/ if the theme's template replaced <ul><?php bp_get_options_nav();?></ul> by <?php bp_nav_menu();?> | |
*/ |
OlderNewer