Update 1.0.89

This commit is contained in:
ultimatemember
2015-03-18 18:38:22 +02:00
parent 1653677136
commit 89722448cb
9 changed files with 70 additions and 45 deletions
+9 -25
View File
@@ -183,6 +183,11 @@ class UM_Query {
***/
function role_data( $role_slug ) {
global $wpdb, $ultimatemember;
// get cache
if ( $ultimatemember->cache->role_data( $role_slug ) ) {
return $ultimatemember->cache->role_data( $role_slug );
}
if ($role_slug == 'admin' || $role_slug == 'member'){
$try = $this->find_post_id('um_role','_um_core',$role_slug);
@@ -212,6 +217,10 @@ class UM_Query {
$array = $ultimatemember->setup->get_initial_permissions( $role_slug );
}
// set cache
$ultimatemember->cache->set_role_data( $role_slug, $array );
return $array;
}
@@ -246,31 +255,6 @@ class UM_Query {
return $array;
}
/***
*** @Counts all user posts
***/
function count_posts($user_id){
$args = array(
'author' => $user_id,
'post_status' => array('publish'),
'post_type' => 'any'
);
$posts = new WP_Query( $args );
$post_count = $posts->found_posts;
return $post_count;
}
/***
*** @Count comments by user
***/
function count_comments( $user_id ) {
$args = array(
'user_id' => $user_id
);
$comments = get_comments( $args );
return count($comments);
}
/***
*** @Capture selected value
***/