- fixed Edit Profile mode;

- added esc functions;
- added Unsplash extension;
- added new conditional setting for admin forms;
This commit is contained in:
nikitasinelnikov
2019-08-01 14:23:13 +03:00
parent 1cc873d458
commit 954dfa7fc5
15 changed files with 229 additions and 110 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+54 -7
View File
@@ -203,16 +203,27 @@ jQuery(document).ready( function() {
var value = conditional[2];
var prefix = form_line.data( 'prefix' );
//var prefix = form_line.parents( '.um-form-table' ).data( 'prefix' );
var condition_field = jQuery( '#' + prefix + '_' + conditional[0] );
var parent_condition = true;
if ( typeof condition_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
parent_condition = check_condition( condition_field.parents('.um-forms-line') );
if ( condition === '=' || condition === '!=' ) {
var condition_field = jQuery( '#' + prefix + '_' + conditional[0] );
if ( typeof condition_field.parents('.um-forms-line').data('conditional') !== 'undefined' ) {
parent_condition = check_condition( condition_field.parents('.um-forms-line') );
}
} else if ( condition === '~' ) {
var selectors = conditional[0].split('|');
var condition_fields = [];
jQuery.each( selectors, function(i) {
condition_fields.push( jQuery( '#' + prefix + '_' + selectors[i] ) );
});
if ( typeof condition_fields[0].parents('.um-forms-line').data('conditional') !== 'undefined' ) {
parent_condition = check_condition( condition_fields[0].parents('.um-forms-line') );
}
}
var own_condition = false;
if ( condition == '=' ) {
if ( condition === '=' ) {
var tagName = condition_field.prop("tagName").toLowerCase();
if ( tagName == 'input' ) {
@@ -225,7 +236,7 @@ jQuery(document).ready( function() {
} else if ( tagName == 'select' ) {
own_condition = ( condition_field.val() == value );
}
} else if ( condition == '!=' ) {
} else if ( condition === '!=' ) {
var tagName = condition_field.prop("tagName").toLowerCase();
if ( tagName == 'input' ) {
@@ -238,6 +249,42 @@ jQuery(document).ready( function() {
} else if ( tagName == 'select' ) {
own_condition = ( condition_field.val() != value );
}
} else if ( condition === '~' ) {
var field_id = form_line.find( form_line.data('field_type') ).data('field_id');
var visible_options = [];
jQuery.each( condition_fields, function(i) {
var condition_field = condition_fields[ i ];
var tagName = condition_field.prop("tagName").toLowerCase();
if ( tagName === 'input' ) {
var input_type = condition_field.attr('type');
if ( input_type === 'checkbox' ) {
if ( value == '1' && condition_field.is(':checked') ) {
visible_options.push( condition_field.data( 'fill_' + field_id ) );
}
}
}
});
var lines_field = jQuery( '[data-field_id="' + field_id + '"]' );
if ( visible_options.length ) {
lines_field.find( 'option' ).hide();
jQuery.each( visible_options, function(i) {
lines_field.find( 'option[value="' + visible_options[ i ] + '"]' ).show();
});
if ( visible_options.indexOf( lines_field.val() ) === -1 ) {
lines_field.val( visible_options[0] );
lines_field.find( 'option' ).attr( 'selected', false ).prop( 'selected', false );
lines_field.find( 'option[value="' + visible_options[0] + '"]' ).attr( 'selected', true ).prop( 'selected', true );
}
own_condition = true;
} else {
lines_field.val( null );
lines_field.find( 'option' ).attr( 'selected', false ).prop( 'selected', false );
}
}
return ( own_condition && parent_condition );
+6 -4
View File
@@ -46,23 +46,25 @@ if ( ! class_exists( 'um\admin\Admin_Functions' ) ) {
global $current_screen;
$screen_id = $current_screen->id;
$is_um_screen = false;
if ( strstr( $screen_id, 'ultimatemember') ||
strstr( $screen_id, 'um_') ||
strstr( $screen_id, 'user' ) ||
strstr( $screen_id, 'profile' ) ||
$screen_id == 'nav-menus' ) {
return true;
$is_um_screen = true;
}
if ( $this->is_plugin_post_type() ) {
return true;
$is_um_screen = true;
}
if ( $this->is_restricted_entity() ) {
return true;
$is_um_screen = true;
}
return false;
return apply_filters( 'um_is_ultimatememeber_admin_screen', $is_um_screen );
}
@@ -691,6 +691,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
'field_id' => $field_data['id']
);
if ( ! empty( $field_data['data'] ) ) {
$data = array_merge( $data, $field_data['data'] );
}
$data_attr = '';
foreach ( $data as $key => $value ) {
$data_attr .= " data-{$key}=\"{$value}\" ";
+18 -21
View File
@@ -135,12 +135,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$tabs = UM()->profile()->tabs();
$tabs_options = array();
$tabs_condition = array();
foreach ( $tabs as $id => $tab ) {
if ( ! empty( $tab['hidden'] ) ) {
continue;
}
if ( isset( $tab['name'] ) ) {
$tabs_options[ $id ] = $tab['name'];
$tabs_condition[] = 'profile_tab_' . $id;
}
if ( isset( $tab['default_privacy'] ) ) {
$fields = array(
array(
@@ -148,6 +155,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'type' => 'checkbox',
'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
'conditional' => array( 'profile_menu', '=', 1 ),
'data' => array( 'fill_profile_menu_default_tab' => $id ),
),
);
} else {
@@ -158,6 +166,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'type' => 'checkbox',
'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
'conditional' => array( 'profile_menu', '=', 1 ),
'data' => array( 'fill_profile_menu_default_tab' => $id ),
),
array(
'id' => 'profile_tab_' . $id . '_privacy',
@@ -185,27 +194,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, $fields );
}
$active_tabs = array();
$tabs = UM()->profile()->tabs_active();
if ( ! empty( $tabs ) ) {
foreach ( $tabs as $id => $info ) {
if ( isset( $info['name'] ) ) {
$active_tabs[ $id ] = $info['name'];
}
}
}
if ( count( $active_tabs ) ) {
$appearances_profile_menu_fields[] = array(
'id' => 'profile_menu_default_tab',
'type' => 'select',
'label' => __( 'Profile menu default tab', 'ultimate-member' ),
'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ),
'options' => $active_tabs,
'conditional' => array( 'profile_menu', '=', 1 ),
'size' => 'small'
);
}
$appearances_profile_menu_fields[] = array(
'id' => 'profile_menu_default_tab',
'type' => 'select',
'label' => __( 'Profile menu default tab', 'ultimate-member' ),
'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ),
'options' => $tabs_options,
'conditional' => array( implode( '|', $tabs_condition ), '~', 1 ),
'size' => 'small'
);
$appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array(
array(
+6
View File
@@ -122,6 +122,12 @@ $premium['user-bookmarks'] = array(
'desc' => 'Allow users to bookmark content from your website',
);
$premium['unsplash'] = array(
'url' => 'https://ultimatemember.com/extensions/unsplash/',
'name' => 'Unsplash',
'desc' => 'Allow users to select a profile cover photo from <a href="https://unsplash.com/" target="_blank">Unsplash</a> from their profile',
);
$free['forumwp'] = array(
'url' => 'https://ultimatemember.com/extensions/forumwp/',
'name' => 'ForumWP',
+1 -1
View File
@@ -27,7 +27,7 @@ if ( ! class_exists( 'UM' ) ) {
* @method UM_User_Tags_API User_Tags_API()
* @method UM_Verified_Users_API Verified_Users_API()
* @method UM_WooCommerce_API WooCommerce_API()
* @method UM_Terms_Conditions_API Terms_Conditions_API()
* @method UM_Terms_Conditions Terms_Conditions()
* @method UM_Private_Content_API Private_Content_API()
* @method UM_User_Location_API User_Location_API()
* @method UM_Photos_API Photos_API()
+50 -45
View File
@@ -9,8 +9,9 @@
function um_profile_content_main( $args ) {
extract( $args );
if ( ! UM()->options()->get( 'profile_tab_main' ) && ! isset( $_REQUEST['um_action'] ) )
if ( ! UM()->options()->get( 'profile_tab_main' ) && ! isset( $_REQUEST['um_action'] ) ) {
return;
}
/**
* UM hook
@@ -164,7 +165,12 @@ function um_profile_content_main( $args ) {
do_action( "um_after_form", $args );
} else { ?>
<div class="um-profile-note"><span><i class="um-faicon-lock"></i><?php echo $can_view; ?></span></div>
<div class="um-profile-note">
<span>
<i class="um-faicon-lock"></i>
<?php echo $can_view; ?>
</span>
</div>
<?php }
}
add_action( 'um_profile_content_main', 'um_profile_content_main' );
@@ -534,7 +540,7 @@ add_action( 'um_after_user_updated', 'um_restore_default_roles', 10, 3 );
function um_editing_user_id_input( $args ) {
if ( UM()->fields()->editing == 1 && UM()->fields()->set_mode == 'profile' && UM()->user()->target_id ) { ?>
<input type="hidden" name="user_id" id="user_id" value="<?php echo UM()->user()->target_id; ?>"/>
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( UM()->user()->target_id ); ?>" />
<?php }
}
@@ -557,13 +563,13 @@ function um_profile_dynamic_meta_desc() {
um_reset_user(); ?>
<meta name="description" content="<?php echo $content; ?>">
<meta name="description" content="<?php echo esc_attr( $content ); ?>">
<meta property="og:title" content="<?php echo um_get_display_name( $user_id ); ?>"/>
<meta property="og:title" content="<?php echo esc_attr( um_get_display_name( $user_id ) ); ?>"/>
<meta property="og:type" content="article"/>
<meta property="og:image" content="<?php echo $avatar; ?>"/>
<meta property="og:url" content="<?php echo $url; ?>"/>
<meta property="og:description" content="<?php echo $content; ?>"/>
<meta property="og:image" content="<?php echo esc_url( $avatar ); ?>"/>
<meta property="og:url" content="<?php echo esc_url( $url ); ?>"/>
<meta property="og:description" content="<?php echo esc_attr( $content ); ?>"/>
<?php
}
@@ -593,7 +599,7 @@ function um_profile_header_cover_area( $args ) {
?>
<div class="um-cover <?php if ( um_user( 'cover_photo' ) || ( $default_cover && $default_cover['url'] ) ) echo 'has-cover'; ?>"
data-user_id="<?php echo um_profile_id(); ?>" data-ratio="<?php echo $args['cover_ratio']; ?>">
data-user_id="<?php echo esc_attr( um_profile_id() ); ?>" data-ratio="<?php echo esc_attr( $args['cover_ratio'] ); ?>">
<?php
/**
@@ -650,7 +656,7 @@ function um_profile_header_cover_area( $args ) {
UM()->fields()->add_hidden_field( 'cover_photo' ); ?>
<div class="um-cover-e" data-ratio="<?php echo $args['cover_ratio']; ?>">
<div class="um-cover-e" data-ratio="<?php echo esc_attr( $args['cover_ratio'] ); ?>">
<?php if ( um_user( 'cover_photo' ) ) {
@@ -668,7 +674,7 @@ function um_profile_header_cover_area( $args ) {
$default_cover = $default_cover['url'];
echo '<img src="' . $default_cover . '" alt="" />';
echo '<img src="' . esc_url( $default_cover ) . '" alt="" />';
} else {
@@ -676,7 +682,7 @@ function um_profile_header_cover_area( $args ) {
<a href="javascript:void(0);" class="um-cover-add"><span class="um-cover-add-i"><i
class="um-icon-plus um-tip-n"
title="<?php _e( 'Upload a cover photo', 'ultimate-member' ); ?>"></i></span></a>
title="<?php esc_attr_e( 'Upload a cover photo', 'ultimate-member' ); ?>"></i></span></a>
<?php }
@@ -743,7 +749,7 @@ function um_profile_header( $args ) {
</span>';
} ?>
<div class="um-header<?php echo $classes; ?>">
<div class="um-header<?php echo esc_attr( $classes ); ?>">
<?php
/**
@@ -767,10 +773,10 @@ function um_profile_header( $args ) {
*/
do_action( 'um_pre_header_editprofile', $args ); ?>
<div class="um-profile-photo" data-user_id="<?php echo um_profile_id(); ?>">
<div class="um-profile-photo" data-user_id="<?php echo esc_attr( um_profile_id() ); ?>">
<a href="<?php echo um_user_profile_url(); ?>" class="um-profile-photo-img"
title="<?php echo um_user( 'display_name' ); ?>"><?php echo $overlay . get_avatar( um_user( 'ID' ), $default_size ); ?></a>
<a href="<?php echo esc_url( um_user_profile_url() ); ?>" class="um-profile-photo-img"
title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>"><?php echo $overlay . get_avatar( um_user( 'ID' ), $default_size ); ?></a>
<?php if ( empty( $disable_photo_uploader ) && empty( UM()->user()->cannot_edit ) ) {
@@ -876,8 +882,8 @@ function um_profile_header( $args ) {
<?php if ( $args['show_name'] ) { ?>
<div class="um-name">
<a href="<?php echo um_user_profile_url(); ?>"
title="<?php echo um_user( 'display_name' ); ?>"><?php echo um_user( 'display_name', 'html' ); ?></a>
<a href="<?php echo esc_url( um_user_profile_url() ); ?>"
title="<?php echo esc_attr( um_user( 'display_name' ) ); ?>"><?php echo um_user( 'display_name', 'html' ); ?></a>
<?php
/**
@@ -962,34 +968,33 @@ function um_profile_header( $args ) {
<?php
$description = get_user_meta( um_user( 'ID' ), 'description', true );
if ( UM()->options()->get( 'profile_show_html_bio' ) ) : ?>
<?php echo make_clickable( wpautop( wp_kses_post( $description ) ) ); ?>
<?php else : ?>
<?php echo esc_html( $description ); ?>
<?php endif; ?>
if ( UM()->options()->get( 'profile_show_html_bio' ) ) {
echo make_clickable( wpautop( wp_kses_post( $description ) ) );
} else {
echo esc_html( $description );
} ?>
</div>
<?php } else if (UM()->fields()->editing == true && $args['show_bio']) { ?>
<div class="um-meta-text">
<textarea id="um-meta-bio"
data-character-limit="<?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?>"
placeholder="<?php _e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
name="<?php echo 'description-' . $args['form_id']; ?>"
id="<?php echo 'description-' . $args['form_id']; ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
data-character-limit="<?php echo esc_attr( UM()->options()->get( 'profile_bio_maxchars' ) ); ?>"
placeholder="<?php esc_attr_e( 'Tell us a bit about yourself...', 'ultimate-member' ); ?>"
name="<?php echo esc_attr( 'description-' . $args['form_id'] ); ?>"
id="<?php echo esc_attr( 'description-' . $args['form_id'] ); ?>"><?php echo UM()->fields()->field_value( 'description' ) ?></textarea>
<span class="um-meta-bio-character um-right"><span
class="um-bio-limit"><?php echo UM()->options()->get( 'profile_bio_maxchars' ); ?></span></span>
<?php
if (UM()->fields()->is_error( 'description' )) {
<?php if ( UM()->fields()->is_error( 'description' ) ) {
echo UM()->fields()->field_error( UM()->fields()->show_error( 'description' ), true );
}
?>
} ?>
</div>
<?php } ?>
<div class="um-profile-status <?php echo um_user( 'account_status' ); ?>">
<div class="um-profile-status <?php echo esc_attr( um_user( 'account_status' ) ); ?>">
<span><?php printf( __( 'This user account status is %s', 'ultimate-member' ), um_user( 'account_status_name' ) ); ?></span>
</div>
@@ -1285,7 +1290,7 @@ function um_add_submit_button_to_profile( $args ) {
<input type="submit" value="<?php esc_attr_e( wp_unslash( $args['primary_btn_word'] ), 'ultimate-member' ); ?>" class="um-button" />
</div>
<div class="um-right um-half">
<a href="<?php echo esc_attr( um_edit_my_profile_cancel_uri() ); ?>" class="um-button um-alt">
<a href="<?php echo esc_url( um_edit_my_profile_cancel_uri() ); ?>" class="um-button um-alt">
<?php _e( wp_unslash( $args['secondary_btn_word'] ), 'ultimate-member' ); ?>
</a>
</div>
@@ -1404,48 +1409,48 @@ function um_profile_menu( $args ) {
$profile_nav_class .= ' active';
} ?>
<div class="um-profile-nav-item um-profile-nav-<?php echo $id . ' ' . $profile_nav_class; ?>">
<div class="um-profile-nav-item um-profile-nav-<?php echo esc_attr( $id . ' ' . $profile_nav_class ); ?>">
<?php if ( UM()->options()->get( 'profile_menu_icons' ) ) { ?>
<a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
<a href="<?php echo esc_url( $nav_link ); ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
<i class="<?php echo $tab['icon']; ?>"></i>
<i class="<?php echo esc_attr( $tab['icon'] ); ?>"></i>
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
<?php } ?>
<span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo $tab['name']; ?></span>
<span class="uimob800-hide uimob500-hide uimob340-hide title"><?php echo esc_html( $tab['name'] ); ?></span>
</a>
<a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
<a href="<?php echo esc_url( $nav_link ); ?>" class="uimob800-hide uimob500-hide uimob340-hide"
title="<?php echo esc_attr( $tab['name'] ); ?>">
<i class="<?php echo $tab['icon']; ?>"></i>
<i class="<?php echo esc_attr( $tab['icon'] ); ?>"></i>
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
<span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
<?php } ?>
<span class="title"><?php echo $tab['name']; ?></span>
<span class="title"><?php echo esc_html( $tab['name'] ); ?></span>
</a>
<?php } else { ?>
<a href="<?php echo $nav_link; ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
<a href="<?php echo esc_url( $nav_link ); ?>" class="uimob800-show uimob500-show uimob340-show um-tip-n"
title="<?php echo esc_attr( $tab['name'] ); ?>" original-title="<?php echo esc_attr( $tab['name'] ); ?>">
<i class="<?php echo $tab['icon']; ?>"></i>
<i class="<?php echo esc_attr( $tab['icon'] ); ?>"></i>
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0 ) { ?>
<span class="um-tab-notifier uimob800-show uimob500-show uimob340-show"><?php echo $tab['notifier']; ?></span>
<?php } ?>
</a>
<a href="<?php echo $nav_link; ?>" class="uimob800-hide uimob500-hide uimob340-hide"
<a href="<?php echo esc_url( $nav_link ); ?>" class="uimob800-hide uimob500-hide uimob340-hide"
title="<?php echo esc_attr( $tab['name'] ); ?>">
<?php if ( isset( $tab['notifier'] ) && $tab['notifier'] > 0) { ?>
<span class="um-tab-notifier"><?php echo $tab['notifier']; ?></span>
<?php } ?>
<span class="title"><?php echo $tab['name']; ?></span>
<span class="title"><?php echo esc_html( $tab['name'] ); ?></span>
</a>
<?php } ?>
</div>
@@ -1471,7 +1476,7 @@ function um_profile_menu( $args ) {
$subnav_link = add_query_arg( 'subnav', $id_s );
$subnav_link = apply_filters( 'um_user_profile_subnav_link', $subnav_link, $id_s, $subtab ); ?>
<a href="<?php echo $subnav_link; ?>" class="<?php if ( $active_subnav == $id_s ) echo 'active'; ?>">
<a href="<?php echo esc_url( $subnav_link ); ?>" class="<?php echo $active_subnav == $id_s ? 'active' : ''; ?>">
<?php echo $subtab; ?>
</a>
+1 -1
View File
@@ -548,7 +548,7 @@ function um_add_submit_button_to_register( $args ) {
<input type="submit" value="<?php esc_attr_e( wp_unslash( $primary_btn_word ), 'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" />
</div>
<div class="um-right um-half">
<a href="<?php echo esc_attr( $secondary_btn_url ); ?>" class="um-button um-alt">
<a href="<?php echo esc_url( $secondary_btn_url ); ?>" class="um-button um-alt">
<?php _e( wp_unslash( $secondary_btn_word ),'ultimate-member' ); ?>
</a>
</div>
+11 -5
View File
@@ -1,6 +1,4 @@
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
@@ -11,8 +9,16 @@ if ( ! defined( 'ABSPATH' ) ) exit;
function um_logout_user_links( $args ) {
?>
<li><a href="<?php echo um_get_core_page( 'account' ); ?>"><?php _e( 'Your account', 'ultimate-member' ); ?></a></li>
<li><a href="<?php echo esc_url( add_query_arg( 'redirect_to', UM()->permalinks()->get_current_url( true ), um_get_core_page( 'logout' ) ) ); ?>"><?php _e('Logout','ultimate-member'); ?></a></li>
<li>
<a href="<?php echo esc_url( um_get_core_page( 'account' ) ); ?>">
<?php _e( 'Your account', 'ultimate-member' ); ?>
</a>
</li>
<li>
<a href="<?php echo esc_url( add_query_arg( 'redirect_to', UM()->permalinks()->get_current_url( true ), um_get_core_page( 'logout' ) ) ); ?>">
<?php _e('Logout','ultimate-member'); ?>
</a>
</li>
<?php
}
+6 -9
View File
@@ -613,7 +613,7 @@ function um_js_redirect( $url ) {
}
register_shutdown_function( function( $url ) {
echo '<script data-cfasync="false" type="text/javascript">window.location = "' . $url . '"</script>';
echo '<script data-cfasync="false" type="text/javascript">window.location = "' . esc_js( $url ) . '"</script>';
}, $url );
if ( 1 < ob_get_level() ) {
@@ -622,7 +622,7 @@ function um_js_redirect( $url ) {
}
} ?>
<script data-cfasync='false' type="text/javascript">
window.location = '<?php echo $url; ?>';
window.location = '<?php echo esc_js( $url ); ?>';
</script>
<?php exit;
} else {
@@ -1414,10 +1414,8 @@ function um_edit_my_profile_cancel_uri( $url = '' ) {
* @return bool
*/
function um_is_on_edit_profile() {
if (isset( $_REQUEST['profiletab'] ) && isset( $_REQUEST['um_action'] )) {
if ($_REQUEST['profiletab'] == 'main' && $_REQUEST['um_action'] == 'edit') {
return true;
}
if ( isset( $_REQUEST['um_action'] ) && $_REQUEST['um_action'] == 'edit' ) {
return true;
}
return false;
@@ -1576,10 +1574,10 @@ function um_is_myprofile() {
/**
* Returns the edit profile link
*
* @return mixed|string|void
* @return string
*/
function um_edit_profile_url() {
if (um_is_core_page( 'user' )) {
if ( um_is_core_page( 'user' ) ) {
$url = UM()->permalinks()->get_current_url();
} else {
$url = um_user_profile_url();
@@ -1587,7 +1585,6 @@ function um_edit_profile_url() {
$url = remove_query_arg( 'profiletab', $url );
$url = remove_query_arg( 'subnav', $url );
$url = add_query_arg( 'profiletab', 'main', $url );
$url = add_query_arg( 'um_action', 'edit', $url );
return $url;
+2 -2
View File
@@ -78,8 +78,8 @@ class UM_Search_Widget extends \WP_Widget {
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'ultimate-member' ); ?>:</label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<?php
+3 -2
View File
@@ -41,7 +41,10 @@ Read about all of the plugin's features at [Ultimate Member](https://ultimatemem
Ultimate Member has a range of extensions that allow you to extend the power of the plugin. You can purchase all of these extensions at a significant discount with our [All Access Pass](https://ultimatemember.com/pricing/) or you can purchase extensions individually.
* [Unsplash](https://ultimatemember.com/extensions/unsplash/) - Allow users to select a profile cover photo from [Unsplash](https://unsplash.com/) from their profile
* [User Bookmarks](https://ultimatemember.com/extensions/user-bookmarks/) - Allow users to bookmark content from your website
* [User Photos](https://ultimatemember.com/extensions/user-photos/) - Allow users to upload photos to their profile
* [Groups](https://ultimatemember.com/extensions/groups/) - Allow users to create and join groups around shared topics, interests etc.
* [Private Content](https://ultimatemember.com/extensions/private-content/) - Display private content to logged in users that only they can access
* [Instagram](https://ultimatemember.com/extensions/instagram/) - Allow users to show their Instagram photos on their profile
* [User Tags](https://ultimatemember.com/extensions/user-tags/) - Lets you add a user tag system to your website
@@ -59,8 +62,6 @@ Ultimate Member has a range of extensions that allow you to extend the power of
* [Notices](https://ultimatemember.com/extensions/notices/) - Alert users to important information using conditional notices
* [Profile Completeness](https://ultimatemember.com/extensions/profile-completeness/) - Encourage or force users to complete their profiles with the profile completeness extension
* [Friends](https://ultimatemember.com/extensions/friends/) - Allows users to become friends by sending & accepting/rejecting friend requests
* [User Photos](https://ultimatemember.com/extensions/user-photos/) - Allow users to upload photos to their profile
* [Groups](https://ultimatemember.com/extensions/groups/) - Allow users to create and join groups around shared topics, interests etc.
= Free Extensions =
+66 -12
View File
@@ -142,19 +142,16 @@
*/
do_action( 'um_profile_menu', $args );
$menu_enabled = UM()->options()->get( 'profile_menu' );
$tabs = UM()->profile()->tabs_active();
if ( um_is_on_edit_profile() ) {
$nav = UM()->profile()->active_tab();
$subnav = UM()->profile()->active_subnav();
$subnav = ! empty( $subnav ) ? $subnav : 'default';
if ( $menu_enabled || ! empty( $tabs[ $nav ]['hidden'] ) ) { ?>
$nav = 'main';
$subnav = UM()->profile()->active_subnav();
$subnav = ! empty( $subnav ) ? $subnav : 'default'; ?>
<div class="um-profile-body <?php echo esc_attr( $nav . ' ' . $nav . '-' . $subnav ); ?>">
<?php
// Custom hook to display tabbed content
// Custom hook to display tabbed content
/**
* UM hook
*
@@ -200,12 +197,69 @@
<div class="clear"></div>
</div>
<?php }
</form>
if ( um_is_on_edit_profile() ) { ?>
</form>
<?php }
<?php } else {
$menu_enabled = UM()->options()->get( 'profile_menu' );
$tabs = UM()->profile()->tabs_active();
$nav = UM()->profile()->active_tab();
$subnav = UM()->profile()->active_subnav();
$subnav = ! empty( $subnav ) ? $subnav : 'default';
if ( $menu_enabled || ! empty( $tabs[ $nav ]['hidden'] ) ) { ?>
<div class="um-profile-body <?php echo esc_attr( $nav . ' ' . $nav . '-' . $subnav ); ?>">
<?php
// Custom hook to display tabbed content
/**
* UM hook
*
* @type action
* @title um_profile_content_{$nav}
* @description Custom hook to display tabbed content
* @input_vars
* [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_profile_content_{$nav}', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_profile_content_{$nav}', 'my_profile_content', 10, 1 );
* function my_profile_content( $args ) {
* // your code here
* }
* ?>
*/
do_action("um_profile_content_{$nav}", $args);
/**
* UM hook
*
* @type action
* @title um_profile_content_{$nav}_{$subnav}
* @description Custom hook to display tabbed content
* @input_vars
* [{"var":"$args","type":"array","desc":"Profile form shortcode arguments"}]
* @change_log
* ["Since: 2.0"]
* @usage add_action( 'um_profile_content_{$nav}_{$subnav}', 'function_name', 10, 1 );
* @example
* <?php
* add_action( 'um_profile_content_{$nav}_{$subnav}', 'my_profile_content', 10, 1 );
* function my_profile_content( $args ) {
* // your code here
* }
* ?>
*/
do_action( "um_profile_content_{$nav}_{$subnav}", $args ); ?>
<div class="clear"></div>
</div>
<?php }
}
do_action( 'um_profile_footer', $args ); ?>
</div>
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
Version: 2.0.54
Version: 2.0.55-beta1
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member