Advertisement
Guest User

Untitled

a guest
May 20th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.44 KB | None | 0 0
  1.     // WCFM wcfmcap Manage Cpt1
  2.   function wcfmcap_is_allow_manage_cpt1( $allow ) {
  3.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  4.     $current_plan = wcfm_get_membership();
  5.     if(isset($current_plan)) {
  6.       $current_group = get_post_meta($current_plan,'associated_group',true);
  7.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  8.     }
  9.  
  10.     $user_id = get_current_user_id();
  11.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  12.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  13.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  14.       if( $manage_cpt1 == 'yes' )  return false;
  15.  
  16.     } elseif(isset($group_capability_options['submit_cpt1'])) {
  17.       $submit_cpt1 = ( isset( $group_capability_options['submit_cpt1'] ) ) ? $group_capability_options['submit_cpt1'] : 'no';
  18.       if( $submit_cpt1 == 'yes' )  return false;
  19.  
  20.     } else {
  21.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  22.       if( $manage_cpt1 == 'yes' )  return false;
  23.     }
  24.     return $allow;
  25.   }
  26.  
  27.   // WCFM wcfmcap Add Cpt1
  28.   function wcfmcap_is_allow_add_cpt1( $allow ) {
  29.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  30.  
  31.     $current_plan = wcfm_get_membership();
  32.     if(isset($current_plan)) {
  33.       $current_group = get_post_meta($current_plan,'associated_group',true);
  34.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  35.     }
  36.  
  37.     $user_id = get_current_user_id();
  38.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  39.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  40.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  41.       if( $manage_cpt1 == 'yes' )  return false;
  42.  
  43.     } elseif(isset($group_capability_options['add_cpt1'])) {
  44.       $add_cpt1 = ( isset( $group_capability_options['add_cpt1'] ) ) ? $group_capability_options['add_cpt1'] : 'no';
  45.       if( $add_cpt1 == 'yes' ) return false;
  46.  
  47.     } else {
  48.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  49.       if( $manage_cpt1 == 'yes' ) return false;
  50.       $add_cpt1 = ( isset( $this->wcfm_capability_options['add_cpt1'] ) ) ? $this->wcfm_capability_options['add_cpt1'] : 'no';
  51.       if( $add_cpt1 == 'yes' ) return false;
  52.     }
  53.     return $allow;
  54.   }
  55.  
  56.   // WCFM wcfmcap Edit Cpt1
  57.   function wcfmcap_is_allow_edit_cpt1( $allow ) {
  58.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  59.  
  60.     $current_plan = wcfm_get_membership();
  61.     if(isset($current_plan)) {
  62.       $current_group = get_post_meta($current_plan,'associated_group',true);
  63.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  64.     }
  65.  
  66.     $user_id = get_current_user_id();
  67.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  68.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  69.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  70.       if( $manage_cpt1 == 'yes' )  return false;
  71.  
  72.     } elseif(isset($group_capability_options['edit_live_cpt1'])) {
  73.       $edit_cpt1 = ( isset( $group_capability_options['edit_live_cpt1'] ) ) ? $group_capability_options['edit_cpt1'] : 'no';
  74.       if( $edit_cpt1 == 'yes' ) return false;
  75.  
  76.     } else {
  77.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  78.       if( $manage_cpt1 == 'yes' ) return false;
  79.       $edit_cpt1 = ( isset( $this->wcfm_capability_options['edit_live_cpt1'] ) ) ? $this->wcfm_capability_options['edit_cpt1'] : 'no';
  80.       if( $edit_cpt1 == 'yes' ) return false;
  81.     }
  82.     return $allow;
  83.   }
  84.  
  85.   // WCFM wcfmcap Publish Cpt1
  86.   function wcfmcap_is_allow_publish_cpt1( $allow ) {
  87.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  88.  
  89.     $current_plan = wcfm_get_membership();
  90.     if(isset($current_plan)) {
  91.       $current_group = get_post_meta($current_plan,'associated_group',true);
  92.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  93.     }
  94.  
  95.     $user_id = get_current_user_id();
  96.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  97.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  98.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  99.       if( $manage_cpt1 == 'yes' )  return false;
  100.  
  101.     } elseif(isset($group_capability_options['publish_cpt1'])) {
  102.       $publish_cpt1 = ( isset( $group_capability_options['publish_cpt1'] ) ) ? $group_capability_options['publish_cpt1'] : 'no';
  103.       if( $publish_cpt1 == 'yes' ) return false;
  104.  
  105.     } else {
  106.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  107.       if( $manage_cpt1 == 'yes' ) return false;
  108.       $publish_cpt1 = ( isset( $this->wcfm_capability_options['publish_cpt1'] ) ) ? $this->wcfm_capability_options['publish_cpt1'] : 'no';
  109.       if( $publish_cpt1 == 'yes' ) return false;
  110.     }
  111.     return $allow;
  112.   }
  113.  
  114.   // WCFM auto publish live cpt1
  115.   function wcfmcap_is_allow_publish_live_cpt1( $allow ) {
  116.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  117.  
  118.     $current_plan = wcfm_get_membership();
  119.     if(isset($current_plan)) {
  120.       $current_group = get_post_meta($current_plan,'associated_group',true);
  121.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  122.     }
  123.  
  124.     $user_id = get_current_user_id();
  125.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  126.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  127.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  128.       if( $manage_cpt1 == 'yes' )  return false;
  129.  
  130.     } elseif(isset($group_capability_options['publish_live_cpt1'])) {
  131.       $publish_live_cpt1 = ( isset( $group_capability_options['publish_live_cpt1'] ) ) ? $group_capability_options['publish_live_cpt1'] : 'no';
  132.       if( $publish_live_cpt1 == 'yes' ) return false;
  133.  
  134.     } else {
  135.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  136.       if( $manage_cpt1 == 'yes' ) return false;
  137.       $publish_live_cpt1 = ( isset( $this->wcfm_capability_options['publish_live_cpt1'] ) ) ? $this->wcfm_capability_options['publish_live_cpt1'] : 'no';
  138.       if( $publish_live_cpt1 == 'yes' ) return false;
  139.     }
  140.     return $allow;
  141.   }
  142.  
  143.   // WCFM wcfmcap Delete Cpt1
  144.   function wcfmcap_is_allow_delete_cpt1( $allow ) {
  145.     global $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options;
  146.  
  147.     $current_plan = wcfm_get_membership();
  148.     if(isset($current_plan)) {
  149.       $current_group = get_post_meta($current_plan,'associated_group',true);
  150.       $group_capability_options = get_post_meta($current_group,'_group_capability_options',true);
  151.     }
  152.  
  153.     $user_id = get_current_user_id();
  154.     $custom_capablity = get_user_meta($user_id,'_wcfm_user_has_custom_capability',true);
  155.     if(isset($custom_capablity) && $custom_capablity == 'yes') {
  156.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  157.       if( $manage_cpt1 == 'yes' )  return false;
  158.  
  159.     } elseif(isset($group_capability_options['delete_cpt1'])) {
  160.       $delete_cpt1 = ( isset( $group_capability_options['delete_cpt1'] ) ) ? $group_capability_options['delete_cpt1'] : 'no';
  161.       if( $delete_cpt1 == 'yes' ) return false;
  162.  
  163.     } else {
  164.       $manage_cpt1 = ( isset( $this->wcfm_capability_options['submit_cpt1'] ) ) ? $this->wcfm_capability_options['submit_cpt1'] : 'no';
  165.       if( $manage_cpt1 == 'yes' ) return false;
  166.       $delete_cpt1 = ( isset( $this->wcfm_capability_options['delete_cpt1'] ) ) ? $this->wcfm_capability_options['delete_cpt1'] : 'no';
  167.       if( $delete_cpt1 == 'yes' ) return false;
  168.     }
  169.     return $allow;
  170.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement