Hiding div based on user role

Basically, just check inside the action if an array of the current user’s roles contains the wholesale role. function content_below_checkout_button() { if ( in_array( ‘wholesale’, wp_get_current_user()->roles ) ) { echo ‘<div style=”text-align: center”><img style=”margin-top:20px; display:inline-block;” src=”/uploads/2020/07/image.png’.$photo->name.'”/></div>’; } } add_action( ‘woocommerce_review_order_after_submit’, ‘content_below_checkout_button’ ); I’m not sure what’s going on with the rest of your code, but … Read more

Show metabox for a special role

The Download stats Metabox has a check for view_product_stats capability in EDD codes. in /easy-digital-downloads/includes/admin/downloads/metabox.php Line:42 if ( current_user_can( ‘view_product_stats’, get_the_ID() ) ) { /** Product Stats */ add_meta_box( ‘edd_product_stats’, sprintf( __( ‘%1$s Stats’, ‘easy-digital-downloads’ ), edd_get_label_singular(), edd_get_label_plural() ), ‘edd_render_stats_meta_box’, $post_type, ‘side’, ‘high’ ); } You can simply remove the view_product_stats capability for Your special … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)