Click here to Skip to main content
15,885,546 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Richard Deeming8-Jun-20 0:24
mveRichard Deeming8-Jun-20 0:24 
GeneralRe: How to successfully Async download a pdf file to a client PC vb.net web application Pin
Amer Amer8-Jun-20 4:11
Amer Amer8-Jun-20 4:11 
QuestionGoogle SignIn and regular account, using the same email Pin
jkirkerx2-Jun-20 12:53
professionaljkirkerx2-Jun-20 12:53 
QuestionWhere can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w18-May-20 21:23
arnold_w18-May-20 21:23 
AnswerRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 0:22
mveRichard Deeming19-May-20 0:22 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
arnold_w19-May-20 9:16
arnold_w19-May-20 9:16 
GeneralRe: Where can passwords for webpages be stored, except in browser itself and Credentials Manager? Pin
Richard Deeming19-May-20 9:25
mveRichard Deeming19-May-20 9:25 
QuestionPHP: Filtering a Wordpress admin post list by role Pin
TectonicEng17-May-20 4:30
TectonicEng17-May-20 4:30 
I'm working on a filter for a Custom Post Type . I need it to filter the list depending on the user's role. The way this should work is the following...

- Users in roles "formusers1" and "formusers2" can post. Users can only see their own posts.
- Users in role "formchecker1" can see all posts assigned role "formusers1' and can approve each post.
- Users in role "formchecker2" can see all posts assigned role "formusers2' and can approve each post.
- Users in roles "formsupervisor" and "administrator" can see everyone's posts.

So far I can filter by roles "formusers1" and "formusers2" using:
$query->set('author', $current_user->ID);
However, when try to filter the list for role "formchecker1" I see posts from all roles. What am I doing wrong? Here's the rest of the code. Thanks for checking out!

add_action('pre_get_posts', 'filter_posts_list');<br />
<br />
function filter_posts_list($query) {<br />
    //GLOBAL VARIABLES<br />
    global $pagenow, $typenow;<br />
<br />
    //MY VARIABLES<br />
    global $current_user;<br />
    get_currentuserinfo();<br />
<br />
    //FILTERING<br />
    if (current_user_can('formchecker1') && ('edit.php' == $pagenow) &&  $typenow == 'mycustomcpt' ) {<br />
        $query->set('author', 'formusers1');<br />
    }<br />
<br />
    if (current_user_can('formchecker2') && ('edit.php' == $pagenow) &&  $typenow == 'mycustomcpt' ) {<br />
        $query->set('author', 'formusers2');<br />
    }<br />
<br />
    if ((current_user_can('formusers1') || current_user_can('formusers2')) && ('edit.php' == $pagenow) &&  $typenow == 'mycustomcpt') {<br />
        $query->set('author', $current_user->ID);<br />
    }<br />
}

SuggestionRe: PHP: Filtering a Wordpress admin post list by role Pin
Richard MacCutchan17-May-20 5:44
mveRichard MacCutchan17-May-20 5:44 
QuestionPowershell timer question Pin
Member 144746071-May-20 10:31
Member 144746071-May-20 10:31 
QuestionWeb API Design Question Pin
Kevin Marois30-Apr-20 8:33
professionalKevin Marois30-Apr-20 8:33 
Questionweb creation Pin
Member 1480564017-Apr-20 22:01
Member 1480564017-Apr-20 22:01 
AnswerRe: web creation Pin
OriginalGriff17-Apr-20 22:13
mveOriginalGriff17-Apr-20 22:13 
AnswerRe: web creation Pin
ZurdoDev30-Apr-20 9:29
professionalZurdoDev30-Apr-20 9:29 
AnswerRe: web creation Pin
Eddy Vluggen30-Apr-20 12:28
professionalEddy Vluggen30-Apr-20 12:28 
AnswerRe: web creation Pin
W Balboos, GHB8-Jun-20 7:45
W Balboos, GHB8-Jun-20 7:45 
Questionmigrations errors in Django web Pin
Mohammad Shafique13-Apr-20 13:32
Mohammad Shafique13-Apr-20 13:32 
AnswerRe: migrations errors in Django web Pin
Richard MacCutchan13-Apr-20 21:03
mveRichard MacCutchan13-Apr-20 21:03 
AnswerRe: migrations errors in Django web Pin
ZurdoDev30-Apr-20 10:42
professionalZurdoDev30-Apr-20 10:42 
QuestionI am looking for School student_result_management Pin
Member 1480089113-Apr-20 7:47
Member 1480089113-Apr-20 7:47 
AnswerRe: I am looking for School student_result_management Pin
Mycroft Holmes13-Apr-20 12:45
professionalMycroft Holmes13-Apr-20 12:45 
GeneralRe: I am looking for School student_result_management Pin
Member 1483624120-May-20 3:35
Member 1483624120-May-20 3:35 
AnswerRe: I am looking for School student_result_management Pin
HenryyyyyMiller27-Aug-20 23:06
HenryyyyyMiller27-Aug-20 23:06 
QuestionPlease can some one help me with this problem Pin
Member 1480089113-Apr-20 6:52
Member 1480089113-Apr-20 6:52 
AnswerRe: Please can some one help me with this problem Pin
Graham Breach13-Apr-20 10:33
Graham Breach13-Apr-20 10:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.