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
<div class="Media Media--center"> | |
<img src="/wp-content/uploads/sites/6/2019/11/doubtful-kitty.jpg" alt="A cat that doubts your ideas." width="100" height="100" class="Media-figure size-full wp-image-1350" /> | |
<div class="Media-body"> | |
<p>Nullam a volutpat urna, nec posuere dui. Cras quis tortor eget sapien ultricies mollis vel non massa. Aenean accumsan vitae ex et pretium. Maecenas in ipsum non sapien tincidunt scelerisque consequat non turpis. Duis accumsan nisl sit amet sodales vestibulum. Pellentesque in nunc elit. Donec vulputate blandit nunc, quis eleifend leo hendrerit a. Phasellus turpis libero, bibendum ut luctus lacinia, euismod nec nisi. </p> | |
</div> | |
</div> |
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
<div class="Media"> | |
<img src="/wp-content/uploads/sites/6/2019/11/doubtful-kitty.jpg" alt="A cat that doubts your ideas." width="100" height="100" class="Media-figure size-full wp-image-1350" /> | |
<div class="Media-body"> | |
<h4 style="margin-top:0;">This is a headline</h4> | |
<p>Here's some body text that is very interesting and is much accentuated by having that cool image or icon to the side.</p> | |
</div> | |
</div> |
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 | |
add_filter( 'bp_docs_map_meta_caps', function( $caps, $cap, $user_id, $args ) { | |
if ( 'bp_docs_create' === $cap ) { | |
// Site admins | |
if ( user_can( $user_id, 'bp_moderate' ) ) { | |
$caps = array( 'exist' ); | |
// If this is a group and the user is a group mod or admin. | |
} else if ( bp_is_group() && ( bp_group_is_mod() || bp_group_is_admin() ) ) { | |
$caps = array( 'exist' ); | |
} else { |
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 | |
add_filter( 'bp_docs_map_meta_caps', function( $caps, $cap, $user_id, $args ) { | |
if ( 'bp_docs_dissociate_from_group' === $cap ) { | |
if ( user_can( $user_id, 'bp_moderate' ) ) { | |
$caps = array( 'exist' ); | |
} else { | |
$caps = array( 'do_not_allow' ); | |
} | |
} | |
return $caps; |
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
add_action( 'bp_actions', function() { | |
if ( ! bp_is_user() || is_super_admin() ) { | |
return; | |
} | |
$user_meta = get_userdata( bp_displayed_user_id() ); | |
if ( in_array( 'subscriber', $user_meta->roles ) ) { | |
bp_core_remove_nav_item( 'profile', 'members' ) | |
} | |
}, 1 ); |
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
add_action( 'wp', function() { | |
if ( bp_is_user() ) { | |
$user_meta = get_userdata( bp_displayed_user_id() ); | |
if ( in_array( 'subscriber', $user_meta->roles ) ) { | |
wp_redirect( home_url() ); | |
exit; | |
} | |
} | |
}, 1 ); |
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 | |
/** | |
* BuddyPress - Members Single Messages Compose | |
* | |
* @package BuddyPress | |
* @subpackage bp-legacy | |
*/ | |
?> |
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 | |
add_filter( 'bp_get_member_avatar', 'my_add_user_level_to_avatars', 10, 2 ); | |
/** | |
* @param string $value Formatted HTML <img> element, or raw avatar URL based on $html arg. | |
* @param array $r Array of parsed arguments. See {@link bp_get_member_avatar()}. | |
*/ | |
function my_add_user_level_to_avatars( $value, $r ) { | |
global $members_template; | |
// The args have already been parsed in bp_get_member_avatar. We'll use them except for the css class. |
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 my_custom_section_registration() { | |
?> | |
<div id="sa-interest-opt-in" class="register-section checkbox"> | |
<label><input type="text" name="my_custom_input" id="my_custom_input" /> Label text.</label> | |
</div> | |
<?php | |
} |