Change WordPress user roles and capabilities Forums How to or FAQ Event Calendar Pro Access for Role but nothing showing in Drafts or Trash

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7429
    edering
    Participant

    In addition to a Role with limited access (Program Editor), we have a way to allow Users to only access Pages and Posts (including Events from Event Calendar Pro) based on a set of Categories called Analytics Group Name seen here: https://www.screencast.com/t/D7RrMSicc It works well, but I noticed that when logged in with a User set to Program Editor SBU004, and I go to Events, I do see the 3 Events I should see (out of 6) in Published. https://www.screencast.com/t/zSAsrVFURWD9 BUT, when I click on the Drafts link (that has 5 total), nothing shows. https://www.screencast.com/t/LYhdaWzQKbY When logged in as an Admin, I see the 5 Drafts https://www.screencast.com/t/h2Cd87xWa9K and at least two are set to SBU004. https://www.screencast.com/t/U92A5g7UByf So why are they not showing when I click on Draft (or anything other than Published)? Here are some of the Role Settings: https://www.screencast.com/t/ocuE4n59NeE

    #7436
    edering
    Participant

    Hi. Any ideas about this?

    #7437
    Vladimir
    Keymaster

    Hi,

    I have made own tests. I can not repeat described issue with post and/or events restricted by built-in categories. If it’s possible to look at your site with admin privileges send URL and user credentials to my support email address.

    #7439
    Vladimir
    Keymaster

    Erik,

    You use custom code to retrieve posts via WordPress API function get_posts() and does not include post_status argument to the arguments list. Function get_posts() uses ‘publish’ value for this argument as a default one in this case, line #2133:

    get_posts()

    So if you wish to make available records with ‘draft’ status too, you have to execute the separate query with ‘post_status’=>’draft’ argument added and concatenate the result of both queries.

    #7451
    edering
    Participant

    Thanks, that worked!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.