mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-15 12:43:33 +09:00
- fixed admin actions hook;
- fixed JS templates for list and grid view when user metakeys contain "-" symbol; - fixed JS template list "$show_block" issue;
This commit is contained in:
@@ -1811,7 +1811,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$admin_actions = apply_filters( 'um_admin_user_actions_hook', null, $user_id );
|
||||
$admin_actions = apply_filters( 'um_admin_user_actions_hook', array(), $user_id );
|
||||
if ( ! empty( $admin_actions ) ) {
|
||||
foreach ( $admin_actions as $id => $arr ) {
|
||||
$url = add_query_arg( array( 'um_action' => $id, 'uid' => $user_id ), um_get_core_page( 'user' ) );
|
||||
|
||||
@@ -1516,9 +1516,9 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$actions = apply_filters( 'um_admin_user_actions_hook', null, um_profile_id() );
|
||||
if ( ! isset( $actions ) || empty( $actions ) ) {
|
||||
return false;
|
||||
$actions = apply_filters( 'um_admin_user_actions_hook', array(), um_profile_id() );
|
||||
if ( empty( $actions ) ) {
|
||||
return $items;
|
||||
}
|
||||
|
||||
foreach ( $actions as $id => $arr ) {
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
* @return null
|
||||
*/
|
||||
function um_admin_user_actions_hook( $actions, $user_id ) {
|
||||
$actions = null;
|
||||
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
//if ( UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
|
||||
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>"
|
||||
data-key="<?php echo esc_attr( $key ); ?>">
|
||||
{{{user.<?php echo $key; ?>}}}
|
||||
{{{user['<?php echo $key; ?>']}}}
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
if ( empty( $key ) ) {
|
||||
unset( $reveal_fields[ $k ] );
|
||||
} ?>
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) {
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) {
|
||||
$show_block = true;
|
||||
} #>
|
||||
<?php }
|
||||
@@ -108,9 +108,9 @@
|
||||
|
||||
<?php foreach ( $reveal_fields as $key ) { ?>
|
||||
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
|
||||
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
|
||||
<strong>{{{user.label_<?php echo $key;?>}}}:</strong> {{{user.<?php echo $key;?>}}}
|
||||
<strong>{{{user['label_<?php echo $key;?>']}}}:</strong> {{{user['<?php echo $key;?>']}}}
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
|
||||
+31
-29
@@ -46,10 +46,10 @@
|
||||
continue;
|
||||
} ?>
|
||||
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
|
||||
<div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>"
|
||||
data-key="<?php echo esc_attr( $key ); ?>">
|
||||
{{{user.<?php echo $key; ?>}}}
|
||||
{{{user['<?php echo $key; ?>']}}}
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
unset( $reveal_fields[ $k ] );
|
||||
} ?>
|
||||
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) {
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) {
|
||||
$show_block = true;
|
||||
} #>
|
||||
<?php }
|
||||
@@ -77,26 +77,26 @@
|
||||
<?php } ?>
|
||||
|
||||
<# if ( $show_block ) { #>
|
||||
<div class="um-member-meta-main">
|
||||
<div class="um-member-meta-main">
|
||||
|
||||
<div class="um-member-meta <?php if ( ! $userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||
<?php foreach ( $reveal_fields as $key ) { ?>
|
||||
<div class="um-member-meta <?php if ( ! $userinfo_animate ) { echo 'no-animate'; } ?>">
|
||||
<?php foreach ( $reveal_fields as $key ) { ?>
|
||||
|
||||
<# if ( typeof user.<?php echo $key; ?> !== 'undefined' ) { #>
|
||||
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
|
||||
<strong>{{{user.label_<?php echo $key;?>}}}:</strong> {{{user.<?php echo $key;?>}}}
|
||||
</div>
|
||||
<# } #>
|
||||
<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
|
||||
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>">
|
||||
<strong>{{{user['label_<?php echo $key;?>']}}}:</strong> {{{user['<?php echo $key;?>']}}}
|
||||
</div>
|
||||
<# } #>
|
||||
|
||||
<?php }
|
||||
<?php }
|
||||
|
||||
if ( $show_social ) { ?>
|
||||
<div class="um-member-connect">
|
||||
{{{user.social_urls}}}
|
||||
</div>
|
||||
<?php } ?>
|
||||
if ( $show_social ) { ?>
|
||||
<div class="um-member-connect">
|
||||
{{{user.social_urls}}}
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<# } #>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@@ -122,18 +122,20 @@
|
||||
<?php do_action( 'um_members_list_just_after_actions_tmpl', $args ); ?>
|
||||
</div>
|
||||
|
||||
<# if ( $show_block ) { #>
|
||||
<?php if ( $userinfo_animate ) { ?>
|
||||
<div class="um-member-card-reveal-buttons">
|
||||
<div class="um-member-more">
|
||||
<a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a>
|
||||
<?php if ( $show_userinfo ) { ?>
|
||||
<# if ( $show_block ) { #>
|
||||
<?php if ( $userinfo_animate ) { ?>
|
||||
<div class="um-member-card-reveal-buttons">
|
||||
<div class="um-member-more">
|
||||
<a href="javascript:void(0);"><i class="um-faicon-angle-down"></i></a>
|
||||
</div>
|
||||
<div class="um-member-less">
|
||||
<a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="um-member-less">
|
||||
<a href="javascript:void(0);"><i class="um-faicon-angle-up"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<# } #>
|
||||
<?php } ?>
|
||||
<# } #>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user