Forum Replies Created

Viewing 15 posts - 421 through 435 (of 2,511 total)
  • Author
    Posts
  • Vladimir
    Keymaster

    Thanks. I got plugin copy. I will look what is going wrong.

    Vladimir
    Keymaster

    Hi,

    Send me the link to plugin (with ajax related features) from wordpress.org/plugins in order I can test this issue.

    in reply to: Restrict access + elementor template #7219
    Vladimir
    Keymaster

    This script placed into functions.php file of the active theme of added as a Must Use plugin will redirect not logged-in user to the wp-login.php page:

    
    // Block URLs from the list for not logged-in users
    add_action('wp_head', 'your_prefix_protect_urls', 110);
    
    function your_prefix_protect_urls() {
        
        if ( is_user_logged_in() ) {
            return;
        }
        
        $blocked_paths = array(
          '/wp-test2/category/post-category-1/'  
        );
        
        $redirect = false;
        $path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
        foreach( $blocked_paths as $blocked_path ) {
            if ( $blocked_path==$path ) {
                $redirect = true;
                break;
            }
        }
        
        if ( !$redirect ) {
            return;
        }
    
        // URL where do you wish redirect not logged-in user
        $redirect_to = '/wp-test2/wp-login.php';
        
        if (headers_sent()) {
    ?>
    <script>
        document.location.href = '<?php echo $redirect_to; ?>';
    </script>    
    <?php
            } else {
                wp_redirect( $redirect_to );
            }
            die;
    
        
    }
    

    Just replace blocked path from ‘/wp-test2/category/post-category-1/’ to yours, like ‘/cat/tutoriels/’, and $redirect_to value to from ‘/wp-test2/wp-login.php’ to the path/URL of your login page.

    in reply to: Enable Access to Amelia Plugin #7218
    Vladimir
    Keymaster

    You should not input this code anywhere. I took it from Amelia plugin source code, just to show why “Amelia” menu is not available for the user with custom role.

    Solution, grant to a user with shop_manager role the 2nd role – wpamelia-manager. Such user will get access to ‘Amelia’ menu after that.

    in reply to: Enable Access to Amelia Plugin #7216
    Vladimir
    Keymaster

    You have to take into account that Amelia plugin create its admin menu “Amelia” with submenu items only for user who has at least one of Amelia’s user roles or who is a superadmin:

    
            $ameliaRole = UserRoles::getUserAmeliaRole(wp_get_current_user());
    
            // Init menu if user is logged in with amelia role
            if (in_array($ameliaRole, ['admin', 'manager', 'provider', 'customer'])) {
                if ($ameliaRole === 'admin') {
                    ErrorService::setNotices();
                }
    
                $menuItems = new Menu($settingsService);
    
    

    where:
    – ‘admin’=’administrator’ WordPress role;
    – ‘manager’=’wpamelia-manager’;
    – ‘provider’=’wpamelia-provider’;
    – ‘customer’=’wpamelia-customer’.
    So you can use your own custom user role but grant it to a user together with one of Amelia own user roles from the list above.

    in reply to: Restrict access + elementor template #7214
    Vladimir
    Keymaster

    I will prepare a piece of code to redirect not logged-in visitor from the custom URL (1-2 days).

    in reply to: Enable Access to Amelia Plugin #7212
    Vladimir
    Keymaster

    Did you try to use existing role from Amelia plugin as a starting point? You can add new role as a copy of selected role, then modify it.

    To say more I need access to Amelia plugin. You can share its zip with support[at-sign]role-editor.com via DropBox or similar service.

    in reply to: Restrict access + elementor template #7208
    Vladimir
    Keymaster

    Thank you for clarification.
    Somehow I missed taxonomy listing pages, like /category/some_cat, or similar. It’s not possible currently to manage view access to such pages itself, only to their content, via view access settings for the posts and/or categories.

    It’s a subject for further development/enhancement.

    in reply to: Flatsome Compatibility #7207
    Vladimir
    Keymaster

    Is it possible to get administrator access to your site? If Yes, send credentials to support [at-sign] role-editor.com
    We will can proceed then checking part by part if it’s possible to make it work.

    in reply to: Restrict access + elementor template #7204
    Vladimir
    Keymaster

    Thanks. I logged-in successfully. Send the link of the page which we test.

    in reply to: Restrict access + elementor template #7201
    Vladimir
    Keymaster

    Hi,

    Is it possible to look at your site with administrator privileges? If Yes, send credentials and noted page link to support [at-sign] role-editor.com

    in reply to: Edit certain Divi elements on a page #7200
    Vladimir
    Keymaster

    It’s not possible with User Role Editor Pro.

    in reply to: Gravity Forms Event Tracking not showing for Role #7196
    Vladimir
    Keymaster

    Hi,

    Resolved.
    Both addons use custom user capabilities, which all were granted to administrator by Gravity Forms plugin automatically, but not exist/created by default.
    I added to new capabilities:
    – gravityforms_mailchimp;
    – gravityforms_event_tracking.
    I granted them to the sdol-admin role. This role sees now both links “Mailchimp” and “Submission Tracking”.

    in reply to: Grant separate permissions additionally to a role #7192
    Vladimir
    Keymaster

    If you setup the code for custom filter ure_restrict_edit_post_type (I gave the link above) to exclude events from the edit restrictions, user will have access to all events without restrictions. It does not depend from post ID list in the edit restrictions form.
    You just need:
    1) replace ‘editor’ with your own role ID, let it be ‘role_a’;
    2) replace ‘post’ with valid custom post type for events, let it be for this example: ‘event’.
    So instead of

    
      if ( in_array( 'editor', $user->roles ) ) {
          if ( $post_type==='post' ) {
    	   $restrict_it = false;
          }
      }
    

    your code will have

    
      if ( in_array( 'role_a', $user->roles ) ) {
          if ( $post_type==='event' ) {
    	   $restrict_it = false;
          }
      }
    

    In assumption that you made all correctly, you can input post ID list after that and check that all events are still available for the role.

    in reply to: Grant separate permissions additionally to a role #7190
    Vladimir
    Keymaster

    You don’t need a code for this. Open ‘Users->User Role Editor’, select role, click ‘Posts Edit’ insert the list of posts ID into the ‘with post ID (comma separated)’ field.
    Or, you can make it individually for selected users via user profile.

Viewing 15 posts - 421 through 435 (of 2,511 total)