ClassiCraft is blocking access to wordpress Dashboard

Discussion in 'ClassiCraft WordPress Theme' started by spottedvarennes, Feb 28, 2015.

  1. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    HI, im trying to add new roles in wordpress, and I notice that editor role cannot access the wordpress dashboard (not classiCraft dashboard, WORDPRESS dashboard) any idea where to change that setting ? I know it classicraft that block it, because if I deactivate the theme, I can access the WP dashboard with editor Role

    THanks
     
  2. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    found it, its in the cc_function.php

    add_action( 'admin_init', 'cc_prevent_admin_access', 1 );

    I think this should be in the theme Settings Page..
     
  3. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    so if you want Administrator and Editor to be able to access the dashboard you need to change this in the cc_function.php.

    add_action( 'admin_init', 'cc_prevent_admin_access', 1 );

    function cc_prevent_admin_access() {
    $isAjax = (defined( 'DOING_AJAX' ) && true === DOING_AJAX) ? true : false;

    if ( !$isAjax ) {
    if ( !current_user_can( 'administrator' ) && !current_user_can( 'editor' ) ) {
    wp_die( YOUR_ARE_NOT_ALLOWED );
    }
    }
    }
     

Share This Page