mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-14 04:06:36 +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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -413,7 +413,7 @@ function um_add_submit_button_to_login( $args ) {
|
||||
|
||||
<div class="um-col-alt">
|
||||
|
||||
<?php if ( isset( $args['show_rememberme'] ) && $args['show_rememberme'] ) {
|
||||
<?php if ( ! empty( $args['show_rememberme'] ) ) {
|
||||
UM()->fields()->checkbox( 'rememberme', __( 'Keep me signed in', 'ultimate-member' ), false ); ?>
|
||||
<div class="um-clear"></div>
|
||||
<?php }
|
||||
@@ -452,7 +452,7 @@ add_action( 'um_after_login_fields', 'um_add_submit_button_to_login', 1000 );
|
||||
* @param $args
|
||||
*/
|
||||
function um_after_login_submit( $args ) {
|
||||
if ( $args['forgot_pass_link'] == 0 ) {
|
||||
if ( empty( $args['forgot_pass_link'] ) ) {
|
||||
return;
|
||||
} ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user