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
| 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
| 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
| <?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
| <?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
| <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
| <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 Media--reverse"> | |
| <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>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sit amet blandit lacus. Proin bibendum eros ut turpis tempor finibus. Vivamus ac scelerisque lectus. Nullam in justo vel mauris fermentum tempus.</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 the Google tag manager script in the header. | |
| * | |
| * @since 1.0.0 | |
| * | |
| */ | |
| function prefix_add_google_tag_manager_script() { | |
| if ( function_exists( 'wp_get_environment_type' ) | |
| && 'production' !== wp_get_environment_type() ) { |