Plugin Directory

Changeset 2261607


Ignore:
Timestamp:
03/16/2020 08:53:04 AM (6 years ago)
Author:
caotu
Message:

Update limit category

Location:
sudo-oauth
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sudo-oauth/trunk/sudo-oauth.php

    r2250354 r2261607  
    5252   $excluded = '';
    5353   $current_user = wp_get_current_user();
    54    if(strpos($current_user->user_email,'@sudo.vn')) {
    55       $multicat_settings = get_option('sudooauth_option_multicat');
    56       if ( $multicat_settings != false ) {
    57          $str_cat_list = '';
    58          foreach($multicat_settings as $value) {
    59             $str_cat_list .= $value.',';
    60          }
    61          $str_cat_list = rtrim($str_cat_list,',');
    62          $excluded = " AND ( t.term_id IN ( $str_cat_list ) OR tt.taxonomy NOT IN ( 'category' ) )";
    63       }
    64    }
     54   if(current_user_can('sudooauth_author')):
     55     if(strpos($current_user->user_email,'@sudo.vn')) {
     56        $multicat_settings = get_option('sudooauth_option_multicat');
     57        if ( $multicat_settings != false ) {
     58           $str_cat_list = '';
     59           foreach($multicat_settings as $value) {
     60              $str_cat_list .= $value.',';
     61           }
     62           $str_cat_list = rtrim($str_cat_list,',');
     63           $excluded = " AND ( t.term_id IN ( $str_cat_list ) OR tt.taxonomy NOT IN ( 'category' ) )";
     64        }
     65     }
     66    endif;
    6567   return $excluded;
    6668}
Note: See TracChangeset for help on using the changeset viewer.