WPIntell

Source evidence

multi role support

Bainternet Posts Creation Limits · review · 2017-01-08T12:48:00+00:00

praisesentiment
mediumseverity
0.5relevance
0replies
Evidence onlycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 1 rows with source links

100.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

0 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

review · 5 stars
iding unresolved
had to make this change to your plugin to do the job for me, alright plugin over all. i’d appreciate if you consider this change to the next version so i’d gladly get back to using the original plugin //check limit by role global $wp_roles; $roles = $this->balp_get_current_user_role(); foreach($roles as $role): $current_role = isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : false; $rules_BY_roles = $this->get_sub_array($options['rules'],'role',$current_role); if ($rules_BY_roles){ foreach((array)$rules_BY_roles as $ke => $arr){ if ($arr['post_type'] == $type || $arr['post_type'] == "any"){ //$count_posts = get_posts(array('author'=>$user_id,'post_type' => $type,'post_status' => $arr['status'],'fields' => 'ids')); $ptype = ($arr['post_type'] == 'any')? "IN ('".implode("', '",get_post_types('', 'names')). "')" : " = '".$arr['post_type']."'"; $time = (isset($arr['time_span']) && $arr['time_span'] != "FOREVER" ) ? " AND TIMEDIFF(NOW(), post_date) < '".$arr['time_span']."'" : ""; $pstatus = ($arr['status'] == 'any') ? "IN ('publish', 'pending', 'draft', 'future', 'private', 'trash')": " = '".$arr['status']."'"; $count = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->posts WHERE post_status ". $pstatus ." AND post_author = $user_id AND post_type $ptype".$time); $count = apply_filters('bapl_Count_filter', $count,$arr, $user_id); if($count >= $arr['limit']){ if ($use_m) $this->current_message = $arr['message']; return true; } } } } endforeach; //get user role public function balp_get_current_user_role() { $current_user = wp_get_current_user(); return $roles = $current_user->roles; }

Comments

0 shown

No comments were stored for this source.