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 some social icons on a profile header | |
function bpfr_socialize_profile () { | |
echo '<br>'; | |
//check if the field contain a value. If it has one show it. | |
if ( $data = bp_get_profile_field_data( 'field=Twitter ' ) ) : | |
?> | |
<a href="http://twitter.com/<?php echo xprofile_get_field_data( 'Twitter', bp_displayed_user_id() );?>/" target="_blank" title="Twitter"><i class="icon-twitter"></i></a> |
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 bpfr_custom_profile_sub_nav() { | |
global $bp; | |
$parent_slug = 'profile'; | |
//Add subnav item | |
bp_core_new_subnav_item( array( | |
'name' => __( 'Create a Group', 'buddypress' ), | |
'slug' => $parent_slug, | |
'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/', | |
'parent_slug' => $parent_slug, |
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 | |
/* | |
Plugin Name: My Groups Widget | |
Description: This BuddyPress widget lists the groups of which the logged in user is a member. | |
Version: 1.0 | |
Revision Date: March 10, 2015 | |
Requires at least: WP 4.0, BuddyPress 2.0 | |
Tested up to: WP 4.1.1, BuddyPress 2.2.1 | |
License: Example: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html | |
Author: Dan |
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 | |
/** | |
/* BuddyPress custom functions | |
*/ | |
// Exit if accessed directly | |
if ( ! defined( 'ABSPATH' ) ) exit; | |
//////////////////////////////// - stuff goes here - ///////////////////////////////// | |
/****************************************** MEMBER TYPES ********************************************/ |
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
/** | |
* this goes into bp-custom.php or can be changed to a plugin | |
* tested with 2012 , BP 2.3.3 and WP 4.3.3 | |
*/ | |
// building navigation tabs | |
function bpfr_post_profile_setup_nav() { | |
global $bp; | |
$parent_slug = 'contributions'; | |
$child_slug = 'posts'; |
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
/* This goes to child-theme style.css and will hide the Profile Edit button. */ | |
#edit-personal-li { | |
display:none!important; | |
} | |
*/ And this is to put into bp-custom.php to get the Edit button on the Profile Settings subnav. | |
Note that there is an array field containing a new css rule for the item. */ | |
function bpex_move_profile_edit_tab() { |
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 using_mt_register_member_types() { | |
bp_register_member_type( 'ville', array( | |
'labels' => array( | |
'name' => __( 'Par Villes', 'textdomain' ), | |
'singular_name' => __( 'Ville', 'textdomain' ), | |
), | |
) ); | |
bp_register_member_type( 'pays', array( |