mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- fixed login form arguments;
- added static cache;
This commit is contained in:
@@ -179,6 +179,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
|
||||
function get_comment_count( $post_id = 0, $exclude_posts = array() ) {
|
||||
static $cache = array();
|
||||
|
||||
if ( isset( $cache[ $post_id ] ) ) {
|
||||
return $cache[ $post_id ];
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$post_id = (int) $post_id;
|
||||
@@ -240,7 +246,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
return array_map( 'intval', $comment_count );
|
||||
$comment_count = array_map( 'intval', $comment_count );
|
||||
$cache[ $post_id ] = $comment_count;
|
||||
|
||||
return $comment_count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user