• i created some custom roles and im trying to use that shortcode, this is the code im using:

    [is role=vendor]
    You are a vendor
    [/is]

    i tried checking if there was something wrong with my custom roles and used this shotcode to test:

    [users role=vendor]
    Admin: [user]
    Contact: [user email]
    [/users]

    this one worked fine, it listed all the users i created with the role “vendor”, so there must be something wrong with the [is role shortcode

    https://wordpress.org/plugins/custom-content-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    I tested this, and [is role] is working on my end, including custom roles.

    In the newest plugin update (3.5.8), I added a parameter to debug this situation. Could you try the following and let me know the output (if any)?

    [is role=vendor debug=true]
    You are a vendor
    [/is]
    Thread Starter laikmosh

    (@laikmosh)

    hello again, i got this output

    CCS_User::is_shortcode
    Current roles
    NULL

    Plugin Author Eliot Akira

    (@miyarakira)

    Hmm, that is strange that the current user has no roles. The only reason I can think of is that the user is not logged in?

    Thread Starter laikmosh

    (@laikmosh)

    no, the user is logged in, actually the [users role=vendor]//do something[/users] is working fine, its just the [is role=vendor] that is not working, so the debugger is saying that the problem is that the current user has no roles?

    if it helps in any way this is the code i used to add the new role, maybe theres something wrong in there that is causing this problem

    $result = add_role( 'administracion', __(
    
    'Administración' ),
    
    array(
    
    'read' => true, // true allows this capability
    'edit_posts' => true, // Allows user to edit their own posts
    'edit_pages' => false, // Allows user to edit pages
    'edit_others_posts' => true, // Allows user to edit others posts not just their own
    'create_posts' => true, // Allows user to create new posts
    'manage_categories' => true, // Allows user to manage post categories
    'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode
    'edit_themes' => false, // false denies this capability. User can’t edit your theme
    'install_plugins' => false, // User cant add new plugins
    'update_plugin' => false, // User can’t update any plugins
    'update_core' => false // user cant perform core updates
    
    )
    
    );
    // End custom user role

    i said “vendor” in the examples i used here, the actual role im using is administracion, thanks!

    Thread Starter laikmosh

    (@laikmosh)

    I noticed there was a fix in the new update, i tried it and with the debugger this is what i got:

    CCS_User::is_shortcode
    Current roles
    Array
    (
    )
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[is role=XXXX] not working’ is closed to new replies.