Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Add one of the following code snippet to the functions.php file of the active theme of your child site(s).
- // Enable Support form for all roles
- add_filter( 'mainwp_branding_role_cap_enable_contact_form', 'mycustom_mainwp_branding_role_cap_enable_contact_form' );
- function mycustom_mainwp_branding_role_cap_enable_contact_form( $input = false ) {
- return true;
- }
- // or allow for specific roles
- add_filter( 'mainwp_branding_role_cap_enable_contact_form', 'mycustom_mainwp_branding_role_cap_enable_contact_form' );
- function mycustom_mainwp_branding_role_cap_enable_contact_form( $input = false ) {
- $user = wp_get_current_user();
- $allowed_roles = array( 'contributor', 'editor', 'administrator', 'author' );
- if( array_intersect( $allowed_roles, $user->roles ) ) {
- return true;
- }
- return $input;
- }
- ?>
Add Comment
Please, Sign In to add comment