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 shanebp_user_groups(){ | |
$group_ids = groups_get_user_groups( bp_get_member_user_id() ); | |
foreach( $group_ids["groups"] as $id ) { | |
$group = groups_get_group( array( 'group_id' => $id ) ); | |
echo '<a href=' . trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ) . '>' . $group->name . '<a/><br>'; |
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 | |
// add the custom column header | |
function philopress_modify_user_columns($column_headers) { | |
$column_headers['extended'] = 'Meta Fields'; | |
return $column_headers; | |
} | |
add_action('manage_users_page_bp-signups_columns','philopress_modify_user_columns'); |
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 | |
// add tab 'Testo' on Members Directory Page | |
function asdf_testo_tab() { | |
if ( ! bp_current_component( 'members' ) ) | |
return; | |
if ( bp_is_current_action( 'testo' ) ) |
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 pp_check_group_name( $group_new ) { | |
if ( 'group-details' == bp_get_groups_current_create_step() ) { | |
$args = array( | |
'per_page' => null, | |
'populate_extras' => false, | |
'update_meta_cache' => false | |
); |
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: BP Email Debug */ | |
add_action( 'bp_send_email_failure', 'pg_bp25_email_debug_failure', 10, 2 ); | |
add_action( 'bp_send_email_success', 'pg_bp25_email_debug_success', 10, 2 ); | |
function pg_bp25_email_debug_failure( $status, $email ) { | |
$email_admin = bp_get_option( 'admin_email' ); | |
if ( is_wp_error( $status ) ) { |
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
<div id="message-thread"> | |
<?php | |
/** | |
* Fires before the display of a single member message thread content. | |
* | |
* @since BuddyPress (1.1.0) | |
*/ | |
do_action( 'bp_before_message_thread_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
function create_post_type_resource() { | |
register_post_type( 'resource', | |
array( | |
'labels' => array( | |
'name' => __( 'Resources' ), | |
'singular_name' => __( 'Resource' ), | |
'add_new' => __( 'Add New' ), | |
'add_new_item' => __( 'Add New Resource' ), | |
'edit' => __( 'Edit' ), | |
'edit_item' => __( 'Edit Resource' ), |
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 a Sort By option to the members loop. | |
// this code assumes that the 'Extended Profile' (xprofile) component is activated | |
// this code assumes that a Profile Field called 'Price' and of type = 'Number' has been created | |
function shanebp_add_sortby_price() { | |
?> | |
<option value="price">Price</option> | |
<?php | |
} |
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
// change the Howdy and Name links so they don't go to profile/edit | |
function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) { | |
$user_id = get_current_user_id(); | |
$current_user = wp_get_current_user(); | |
$profile_url = bp_loggedin_user_domain(); | |
if ( 0 != $user_id ) { | |
$avatar = get_avatar( $user_id, 28 ); | |
$howdy = sprintf( __('Welcome, %1$s'), $current_user->display_name ); | |
$class = empty( $avatar ) ? '' : 'with-avatar'; |