Replies
Hi Tomasz,
I am glad that problem is resolved. But if I were you the code will be something like this
$the_media_query = new MPP_Media_Query( array('user_id' => bp_displayed_user_id() ) );
Thank You
RaviHi Chirstian,
I have set the video resolution as per YouTube. Please check and let me know if it is working on not.
Thank You
RaviHi Dandy,
Please try the following code. I have created role using WP Role Editor and test.
function buddydev_remove_unwanted_menu() { global $wp_admin_bar; $user = wp_get_current_user(); $remove = false; // teacher, principal your role id if ( in_array( 'teacher', (array) $user->roles ) ) { $remove = true; } elseif ( in_array( 'principal', (array) $user->roles ) ) { $remove = true; } if ( $remove ) { $node_ids = array( 'my-account-xprofile-edit', 'my-account-xprofile-change-avatar', 'my-account-xprofile-change-cover-image' ); foreach( $node_ids as $id ) { $wp_admin_bar->remove_node( $id ); } } } add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
Let me know if It is working for you or not.
Thank You
RaviHi Christian,
Sure, I will looking into and will update you by Monday.
Thank You
RaviHi Phillippe,
File location is in WordPress Plugin directory ‘mediapress/assets/css/mpp-core.css’. In this file you need to modify the following class
.mpp-lightbox-content .mpp-lightbox-media-container .mpp-lightbox-activity-container
Thank You
RaviHi Dandy,
Thank you for the acknowledgement that You are using User Role Editor to create user role teacher or principal. I thought teacher and principal are BuddyPress Member type. I will post here the new code.
Thank You
RaviHi Dandy,
There is problem with your code ‘current_user_can’ is a WordPress function and works only with WordPress Roles and Capabilities. Please try the following code
function buddydev_remove_unwanted_menu() { if( ! is_user_logged_in() || ! function_exists( 'buddypress' ) ) { return; } global $wp_admin_bar; $is_teacher = bp_has_member_type( bp_loggedin_user_id(), 'teacher' ); $is_principal = bp_has_member_type( bp_loggedin_user_id(), 'principal' ); if ( $is_teacher || $is_principal ) { // place the node id you want to hide $node_ids = array( 'my-account-xprofile-edit', 'my-account-xprofile-change-avatar', 'my-account-xprofile-change-cover-image' ); foreach( $node_ids as $id ) { $wp_admin_bar->remove_node( $id ); } } } add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
Hi Dandy,
Can You please share the code block that you are using?. I have tested this code on my local server and It is working for me.
Thank You
RaviHi Dandy,
Yes, it can be done to hide and show these items based on user role or capabilities. Please take a look the following url for WordPress User role and capability.
https://codex.wordpress.org/Roles_and_Capabilities
function buddydev_remove_unwanted_menu() { global $wp_admin_bar; /** * * either you can pass the capability or the user role like * current_user_can('edit_posts') with user capability * current_user_can('author') with user role * **/ if ( current_user_can('edit_posts') ) { // place the node id you want to hide $node_ids = array( 'my-account-xprofile-edit', 'my-account-xprofile-change-avatar', 'my-account-xprofile-change-cover-image' ); foreach( $node_ids as $id ) { $wp_admin_bar->remove_node( $id ); } } } add_action( 'wp_before_admin_bar_render', 'buddydev_remove_unwanted_menu' );
Please let me know if it works for you or not.
Thank You
Ravi