Forum Replies Created

Viewing 15 posts - 676 through 690 (of 2,529 total)
  • Author
    Posts
  • Vladimir
    Keymaster

    I made available Beta 3 version 4.54.1.b3, which includes the fix for issue you discovered. It’s available from Download page after login.

    Vladimir
    Keymaster

    Thank you for this bug report. I reproduced the issue and work on the fix.

    in reply to: Not being assigned forum role upon subscription #6195
    Vladimir
    Keymaster

    I wrote answer in assumption that you create custom role with URE.

    bbPress creates its roles on the fly, via code. So if you use some of bbPress filters to add your own role, it may be correct. If you use right filter, bbPress should show your role at its own roles drop-down lists. Try Settings->Forums->Roles to set bbPress your own default role for new registered users.
    Or try to redefine bbPress default role using its ‘bbp_get_default_role’ filter:

    
    bbpress/includes/core/options.php:535:  
    return apply_filters( 'bbp_get_default_role', get_option( '_bbp_default_role', $default ) );
    
    in reply to: Not being assigned forum role upon subscription #6193
    Vladimir
    Keymaster

    Hi,

    bbPress uses as a forum roles only its own built-in roles: bbp_participant, bbp_spectator, etc. bbPress processes them separately from other existing roles. Thus any other role with bbPress user capabilities is shown as a custom role, not a forum role.

    It does not matter, as finally, user permissions are defined as a simple sum of user capabilities included into all roles granted to this user.

    in reply to: deliver another language file for one user role #6188
    Vladimir
    Keymaster

    Hi,

    Site admin can install needed language file for WordPress temporally changing site language at the Settings->General page. (Change language, update settings, change language back).

    WordPress offers special filter ‘locale’, which allows to automatically change language according your own conditions. You may use code below as a starting point, change ‘author’ role to your own:

    
    // Change site language for a role
    add_filter( 'locale', 'change_site_lang_for_role', 10, 1 );
    
    function change_site_lang_for_role( $locale ) {
        
        if ( !is_user_logged_in() ) {
            return $locale;
        }
        
        $user = wp_get_current_user();
        if ( !is_array( $user->roles ) ) {
            return $locale;
        }
        
        if ( in_array('author', $user->roles ) ) {
        
            $locale = 'de_DE';
        }
    
        return $locale;
    }
    // end of change_site_lang_for_role()
    
    in reply to: Remove Item From Top Admin Menu #6187
    Vladimir
    Keymaster

    Hi Paul,

    Thank you for the information.

    Vladimir
    Keymaster

    Does left side admin menu “Profile->Your profile” is available for your ‘editor’ role?
    If ‘Not’, do you see ‘Admin menu” button at “Users->User Role Editor”.
    If ‘Yes’, open “Admin Menu” for ‘editor’ role and check if you didn’t block “Profile->Your profile” menu item suddenly for ‘editor’ role.

    Vladimir
    Keymaster

    Hi,

    Setup this code as Must Use plugin or add it to your active Theme. It leaves only 2 tabs at WC->Settings page: General and Payments. And replace ‘orders_manager’ role ID with your own one.
    In order to leave Payments only, you need apply more programming efforts, replace link of WC-Settings menu from default one to
    wp-admin/admin.php?page=wc-settings&tab=checkout

    
    add_filter('woocommerce_settings_tabs_array', 'change_wc_settings_tabs', 30);
    
    function change_wc_settings_tabs( $pages ) {
        
    
        $user = wp_get_current_user();
        if ( in_array( 'orders_manager', $user->roles ) ) {
            //unset( $pages['general']);      // General
            unset( $pages['products']);     // Products
            unset( $pages['tax']);          // Tax
            //unset( $pages['checkout']);       // Payments
            unset( $pages['account']);        // Accounts & Privacy
            unset( $pages['email']);          // Emails
            unset( $pages['advanced']);       // Advanced
        }
      
      return $pages;
    }
    
    in reply to: Remove Item From Top Admin Menu #6178
    Vladimir
    Keymaster

    Hi,

    What plugin adds ‘Templates’ menu? Is it available at wordpress.org/plugins?

    Vladimir
    Keymaster

    Thanks for letting me know that you found a solution.

    in reply to: How to remove ability to modify comments? #6175
    Vladimir
    Keymaster

    Hi,

    Generally, user who can edit posts, automatically can edit comments sent to posts, which user can edit.
    It’s possible to hide/block selected admin menu item using this add-on:
    https://www.role-editor.com/block-admin-menu-items

    in reply to: Enable Edit CSS for Administrators in Multisite #6165
    Vladimir
    Keymaster

    Code belongs to wp-includes/capabilities.php

    in reply to: Enable Edit CSS for Administrators in Multisite #6163
    Vladimir
    Keymaster

    edit_css together with unfiltered_html are not allowed at WordPress core by default for WP multisite.

    
    case 'edit_css':
    case 'unfiltered_html':
    	// Disallow unfiltered_html for all users, even admins and super admins.
    	if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) {
    		$caps[] = 'do_not_allow';
    	} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
    		$caps[] = 'do_not_allow';
    

    Workaround:
    URE Pro should be network enabled.
    Go to “Network Admin -> Settings -> User Role Editor -> Multisite” tab and turn ON ‘Enable “unfiltered_html” capability’ checkbox.

    in reply to: How to hide content via css #6159
    Vladimir
    Keymaster

    Hi Tobias,

    jQuery .css( propertyName, value) method allows to change CSS of selected element on the fly (official documentation page),
    Like this:

    
    jQuery('.html_header_top.html_header_sticky').css('padding-top', 0);
    jQuery('#top').css('padding-top', 0);
    ...
    

    It’s possible to work with clear CSS also:

    
    // Additional options for URE
    
    // Hide parts of front-end page for selected role
    add_filter( 'ure_role_additional_options', 'ure_add_change_front_end_css', 10, 1 );
    
    function ure_add_change_front_end_css( $items ) {
        
        $item = URE_Role_Additional_Options::create_item( 'change_front_end_css', esc_html__('Change Front-end CSS', 'user-role-editor'), 'wp_head', 'ure_change_front_end_css' );
        $items[$item->id] = $item;
        
        return $items;
    }
    
    function ure_change_front_end_css() {
    
    ?>
    <style>
    
    .html_header_top.html_header_sticky #top #wrap_all #main {
        padding-top: 0px !important;
    }
        
        
    </style>
    <?php
    }
    
    in reply to: Redirect visitors to login page #6157
    Vladimir
    Keymaster

    Hi,

    Content view restrictions add-on includes ‘Logged in only” and redirection action for selected posts/pages in case of access error. If redirection URL field is empty, visitor is redirected to login page.

    URE does not have similar option for a whole website. You need install another plugin or custom code for this purpose, like this:

    
    // Redirect users who arent logged in...
    function members_only() {
        global $pagenow;
        // Check to see if user in not logged in and not on the login page
        if( !is_user_logged_in() && $pagenow != 'wp-login.php' )
              auth_redirect();
    }
    add_action( 'wp', 'members_only' ); 
    

    Code sample was taken here.

Viewing 15 posts - 676 through 690 (of 2,529 total)