mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Update 1.0.77
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
|
||||
.redux-sidebar .redux-group-menu li.active a, .admin-color-fresh .redux-sidebar .redux-group-menu li.activeChild a {
|
||||
color: #3ba1da !important;
|
||||
background: #e5e5e5;
|
||||
background: #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.redux-sidebar .redux-group-menu li.activeChild.hasSubSections a {
|
||||
@@ -198,8 +198,8 @@
|
||||
}
|
||||
|
||||
.redux-sidebar .redux-group-menu li.activeChild.hasSubSections ul.subsection li.active a {
|
||||
background: #555 !important;
|
||||
color: #fff !important;
|
||||
color: #3ba1da !important;
|
||||
background: #e5e5e5 !important;
|
||||
}
|
||||
|
||||
.redux-sidebar .redux-group-menu li.activeChild.hasSubSections .active a:after {
|
||||
|
||||
@@ -286,13 +286,22 @@ jQuery(document).ready(function() {
|
||||
submit font icon
|
||||
**/
|
||||
jQuery(document).on('click', '#UM_fonticons a.um-admin-modal-back:not(.um-admin-modal-cancel)', function(){
|
||||
var v_id = '';
|
||||
var icon_selected = jQuery(this).attr('data-code');
|
||||
if (icon_selected != ''){
|
||||
jQuery('#' + jQuery(this).attr('data-modal') ).find('input#_icon').val( icon_selected );
|
||||
jQuery('#' + jQuery(this).attr('data-modal') ).find('span.um-admin-icon-value').html('<i class="'+icon_selected+'"></i>');
|
||||
jQuery('#' + jQuery(this).attr('data-modal') ).find('.um-admin-icon-clear').show();
|
||||
if ( jQuery(this).attr('data-modal') ) {
|
||||
v_id = '#' + jQuery(this).attr('data-modal');
|
||||
} else {
|
||||
v_id = '.postbox';
|
||||
}
|
||||
jQuery( v_id ).find('input#_icon,input#_um_icon').val( icon_selected );
|
||||
jQuery( v_id ).find('span.um-admin-icon-value').html('<i class="'+icon_selected+'"></i>');
|
||||
jQuery( v_id ).find('.um-admin-icon-clear').show();
|
||||
}
|
||||
jQuery(this).attr('data-code', '');
|
||||
if ( v_id == '.postbox' ) {
|
||||
um_admin_remove_modal();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -302,7 +311,7 @@ jQuery(document).ready(function() {
|
||||
var element = jQuery(this).parents('p');
|
||||
jQuery('#UM_fonticons a.um-admin-modal-back').attr('data-code', '');
|
||||
element.find('input[type=hidden]').val('');
|
||||
element.find('.um-admin-icon-value').html('No icon');
|
||||
element.find('.um-admin-icon-value').html('No Icon');
|
||||
jQuery(this).hide();
|
||||
});
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ class UM_Admin_Metabox {
|
||||
|
||||
<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo $back; ?>">Choose Icon</a>
|
||||
|
||||
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No icon<?php } ?></span>
|
||||
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No Icon<?php } ?></span>
|
||||
|
||||
<input type="hidden" name="_icon" id="_icon" value="<?php echo (isset( $this->edit_mode_value ) ) ? $this->edit_mode_value : ''; ?>" />
|
||||
|
||||
@@ -645,7 +645,7 @@ class UM_Admin_Metabox {
|
||||
|
||||
<a href="#" class="button" data-modal="UM_fonticons" data-modal-size="normal" data-dynamic-content="um_admin_fonticon_selector" data-arg1="" data-arg2="" data-back="<?php echo $back; ?>">Choose Icon</a>
|
||||
|
||||
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No icon<?php } ?></span>
|
||||
<span class="um-admin-icon-value"><?php if ( $this->edit_mode_value ) { ?><i class="<?php echo $this->edit_mode_value; ?>"></i><?php } else { ?>No Icon<?php } ?></span>
|
||||
|
||||
<input type="hidden" name="_icon" id="_icon" value="<?php echo (isset( $this->edit_mode_value ) ) ? $this->edit_mode_value : ''; ?>" />
|
||||
|
||||
|
||||
@@ -714,15 +714,3 @@ span.um-req {
|
||||
position: relative;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.um-large-text {
|
||||
font-size: 18px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.um-large-text span {
|
||||
background: #eee;
|
||||
padding: 2px 4px;
|
||||
color: #333;
|
||||
border-radius: 3px;
|
||||
}
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -16,6 +16,7 @@ if(isset($_FILES[$id]['name'])) {
|
||||
|
||||
$temp = $_FILES[$id]["tmp_name"];
|
||||
$file = $_FILES[$id]["name"];
|
||||
$file = str_replace(array('#','(',')','+','&','?','%','{','}','[',']','=',',',';','>','<','~',':','$',' '),'',$file);
|
||||
$extension = pathinfo($file, PATHINFO_EXTENSION);
|
||||
|
||||
$error = $ultimatemember->files->check_file_upload( $temp, $extension, $id );
|
||||
|
||||
@@ -16,7 +16,7 @@ if(isset($_FILES[$id]['name'])) {
|
||||
|
||||
$temp = $_FILES[$id]["tmp_name"];
|
||||
$file = $_FILES[$id]["name"];
|
||||
$file = str_replace(array('(',')','+','&','?','%','{','}','[',']','=',',',';',' '),'',$file);
|
||||
$file = str_replace(array('#','(',')','+','&','?','%','{','}','[',']','=',',',';','>','<','~',':','$',' '),'',$file);
|
||||
$file = strtolower($file);
|
||||
|
||||
$error = $ultimatemember->files->check_image_upload( $temp, $id );
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $changes['hide_in_members'] ) && $changes['hide_in_members'] == 'No' ){
|
||||
if ( isset( $changes['hide_in_members'] ) && $changes['hide_in_members'] == __('No','ultimatemember') ) {
|
||||
delete_user_meta( um_user('ID'), 'hide_in_members' );
|
||||
unset( $changes['hide_in_members'] );
|
||||
}
|
||||
|
||||
@@ -168,8 +168,9 @@
|
||||
}
|
||||
|
||||
if ( um_user( $status . '_action' ) == 'show_message' && um_user( $status . '_message' ) != '' ) {
|
||||
$url = $ultimatemember->permalinks->add_query( 'message', $status );
|
||||
$url = $ultimatemember->permalinks->add_query( 'uid', um_user('ID') );
|
||||
$url = um_get_core_page('register');
|
||||
$url = add_query_arg( 'message', $status, $url );
|
||||
$url = add_query_arg( 'uid', um_user('ID'), $url );
|
||||
exit( wp_redirect( $url ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -791,6 +791,7 @@ class UM_Builtin {
|
||||
'upload_text' => __('Upload your photo here','ultimatemember'),
|
||||
'icon' => 'um-faicon-camera',
|
||||
'crop' => 1,
|
||||
'max_size' => ( um_get_option('profile_photo_max_size') ) ? um_get_option('profile_photo_max_size') : 999999999,
|
||||
'min_width' => str_replace('px','',um_get_option('profile_photosize')),
|
||||
'min_height' => str_replace('px','',um_get_option('profile_photosize')),
|
||||
'private_use' => true,
|
||||
@@ -804,6 +805,7 @@ class UM_Builtin {
|
||||
'upload_text' => __('Upload profile cover here','ultimatemember'),
|
||||
'icon' => 'um-faicon-picture-o',
|
||||
'crop' => 2,
|
||||
'max_size' => ( um_get_option('cover_photo_max_size') ) ? um_get_option('cover_photo_max_size') : 999999999,
|
||||
'modal_size' => 'large',
|
||||
'ratio' => str_replace(':1','',um_get_option('profile_cover_ratio')),
|
||||
'min_width' => um_get_option('cover_min_width'),
|
||||
|
||||
@@ -24,7 +24,14 @@
|
||||
|
||||
'icon' => 'um-faicon-plug',
|
||||
'title' => __( 'Add ons','ultimatemember'),
|
||||
'fields' => $array
|
||||
|
||||
);
|
||||
|
||||
$sections[] = array(
|
||||
|
||||
'subsection' => true,
|
||||
'title' => __( 'Built-in Add ons','ultimatemember'),
|
||||
'fields' => $array,
|
||||
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/***
|
||||
*** @Control comment author display
|
||||
***/
|
||||
add_filter('get_comment_author_link', 'um_comment_link_to_profile', 10000 );
|
||||
function um_comment_link_to_profile( $return ) {
|
||||
global $comment, $ultimatemember;
|
||||
if ( isset( $comment->user_id ) && !empty( $comment->user_id ) ) {
|
||||
|
||||
if ( isset( $ultimatemember->user->cached_user[ $comment->user_id ] ) && $ultimatemember->user->cached_user[ $comment->user_id ] ) {
|
||||
|
||||
$return = '<a href="'. $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
|
||||
|
||||
} else {
|
||||
|
||||
um_fetch_user($comment->user_id);
|
||||
$ultimatemember->user->cached_user[ $comment->user_id ] = array('url' => um_user_profile_url(), 'name' => um_user('display_name') );
|
||||
$return = '<a href="'. $ultimatemember->user->cached_user[$comment->user_id]['url'] . '">' . $ultimatemember->user->cached_user[$comment->user_id]['name'] . '</a>';
|
||||
um_reset_user();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
if ( !$value ) return '';
|
||||
|
||||
if ( isset( $data['validate'] ) && $data['validate'] != '' && strstr( $data['validate'], 'url' ) ) {
|
||||
if ( ( isset( $data['validate'] ) && $data['validate'] != '' && strstr( $data['validate'], 'url' ) ) || ( $data['type'] == 'url' ) ) {
|
||||
$alt = ( isset( $data['url_text'] ) && !empty( $data['url_text'] ) ) ? $data['url_text'] : $value;
|
||||
$url_rel = ( isset( $data['url_rel'] ) ) ? 'rel="nofollow"' : '';
|
||||
if( !strstr( $value, 'http' )
|
||||
|
||||
@@ -249,6 +249,8 @@ class UM_Shortcodes {
|
||||
***/
|
||||
function convert_user_tags( $str ) {
|
||||
|
||||
$value = '';
|
||||
|
||||
$pattern_array = array(
|
||||
'{first_name}',
|
||||
'{last_name}',
|
||||
@@ -268,11 +270,14 @@ class UM_Shortcodes {
|
||||
|
||||
if ( $usermeta == 'user_avatar_small' ) {
|
||||
$value = um_user('profile_photo', 40);
|
||||
$str = preg_replace('/'.$pattern.'/', $value , $str );
|
||||
} elseif ( um_user( $usermeta ) ){
|
||||
$value = um_user( $usermeta );
|
||||
}
|
||||
|
||||
if ( um_user( $usermeta ) ){
|
||||
$str = preg_replace('/'.$pattern.'/', um_user($usermeta) , $str );
|
||||
$value = apply_filters("um_profile_tag_hook__{$usermeta}", $value, um_user('ID') );
|
||||
|
||||
if ( $value ) {
|
||||
$str = preg_replace('/'.$pattern.'/', $value , $str );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+312
-40
@@ -51,10 +51,31 @@ class UM_User {
|
||||
return $new;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Set user
|
||||
***/
|
||||
function set( $user_id = null, $clean=false ) {
|
||||
/**
|
||||
* @function set()
|
||||
*
|
||||
* @description This method lets you set a user. For example, to retrieve a profile or anything related to that user.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->set( $user_id, $clean = false ); ?>
|
||||
*
|
||||
* @param $user_id (numeric) (optional) Which user to retrieve. A numeric user ID
|
||||
* @param $clean (boolean) (optional) Should be true or false. Basically, if you did not provide a user ID It will set the current logged in user as a profile
|
||||
*
|
||||
* @returns This API method does not return anything. It sets user profile and permissions and allow you to retrieve any details for that user.
|
||||
*
|
||||
* @example The following example makes you set a user and retrieve their display name after that using the user API.
|
||||
|
||||
<?php
|
||||
|
||||
$ultimatemember->user->set( 12 );
|
||||
$display_name = $ultimatemember->user->profile['display_name']; // Should print user display name
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function set( $user_id = null, $clean = false ) {
|
||||
global $ultimatemember;
|
||||
|
||||
if ( isset( $this->profile ) ) {
|
||||
@@ -168,9 +189,31 @@ class UM_User {
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Automatic login by user id
|
||||
***/
|
||||
/**
|
||||
* @function auto_login()
|
||||
*
|
||||
* @description This method lets you auto sign-in a user to your site.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->auto_login( $user_id, $rememberme = false ); ?>
|
||||
*
|
||||
* @param $user_id (numeric) (required) Which user ID to sign in automatically
|
||||
* @param $rememberme (boolean) (optional) Should be true or false. If you want the user sign in session to use cookies, use true
|
||||
*
|
||||
* @returns Sign in the specified user automatically.
|
||||
*
|
||||
* @example The following example lets you sign in a user automatically by their ID.
|
||||
|
||||
<?php $ultimatemember->user->auto_login( 2 ); ?>
|
||||
|
||||
*
|
||||
*
|
||||
* @example The following example lets you sign in a user automatically by their ID and makes the plugin remember their session.
|
||||
|
||||
<?php $ultimatemember->user->auto_login( 10, true ); ?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function auto_login( $user_id, $rememberme = 0 ) {
|
||||
wp_set_current_user($user_id);
|
||||
wp_set_auth_cookie($user_id, $rememberme );
|
||||
@@ -190,9 +233,32 @@ class UM_User {
|
||||
update_user_meta( $this->id, '_um_cool_but_hard_to_guess_plain_pw', $plain );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Set user's role
|
||||
***/
|
||||
/**
|
||||
* @function set_role()
|
||||
*
|
||||
* @description This method assign a role to a user. The user must be already set before processing this API method.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->set_role( $role ); ?>
|
||||
*
|
||||
* @param $role (string) (required) The user role slug you want to assign to user.
|
||||
*
|
||||
* @returns Changes user role if the given user role was a valid plugin role.
|
||||
*
|
||||
* @example Set a user and give them the role community-member
|
||||
|
||||
<?php
|
||||
|
||||
// Sets a user. Can accept numeric user ID
|
||||
um_fetch_user( 14 );
|
||||
|
||||
// Change user role
|
||||
$ultimatemember->user->set_role('community-member');
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function set_role( $role ){
|
||||
|
||||
do_action('um_before_user_role_is_changed');
|
||||
@@ -252,9 +318,27 @@ class UM_User {
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'resetpw_email' );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @approves a user
|
||||
***/
|
||||
/**
|
||||
* @function approve()
|
||||
*
|
||||
* @description This method approves a user membership and sends them an optional welcome/approval e-mail.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->approve(); ?>
|
||||
*
|
||||
* @returns Approves a user membership.
|
||||
*
|
||||
* @example Approve a pending user and allow him to sign-in to your site.
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 352 );
|
||||
$ultimatemember->user->approve();
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function approve(){
|
||||
global $ultimatemember;
|
||||
|
||||
@@ -284,27 +368,81 @@ class UM_User {
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'checkmail_email' );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @pending review
|
||||
***/
|
||||
/**
|
||||
* @function pending()
|
||||
*
|
||||
* @description This method puts a user under manual review by administrator and sends them an optional e-mail.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->pending(); ?>
|
||||
*
|
||||
* @returns Puts a user under review and sends them an email optionally.
|
||||
*
|
||||
* @example An example of putting a user pending manual review
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 54 );
|
||||
$ultimatemember->user->pending();
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function pending(){
|
||||
global $ultimatemember;
|
||||
$this->set_status('awaiting_admin_review');
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'pending_email' );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @reject membership
|
||||
***/
|
||||
/**
|
||||
* @function reject()
|
||||
*
|
||||
* @description This method rejects a user membership and sends them an optional e-mail.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->reject(); ?>
|
||||
*
|
||||
* @returns Rejects a user membership.
|
||||
*
|
||||
* @example Reject a user membership example
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 114 );
|
||||
$ultimatemember->user->reject();
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function reject(){
|
||||
global $ultimatemember;
|
||||
$this->set_status('rejected');
|
||||
$ultimatemember->mail->send( um_user('user_email'), 'rejected_email' );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @deactivate membership
|
||||
***/
|
||||
/**
|
||||
* @function deactivate()
|
||||
*
|
||||
* @description This method deactivates a user membership and sends them an optional e-mail.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->deactivate(); ?>
|
||||
*
|
||||
* @returns Deactivates a user membership.
|
||||
*
|
||||
* @example Deactivate a user membership with the following example
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 32 );
|
||||
$ultimatemember->user->deactivate();
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function deactivate(){
|
||||
global $ultimatemember;
|
||||
$this->set_status('inactive');
|
||||
@@ -343,9 +481,32 @@ class UM_User {
|
||||
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get user's role in UM
|
||||
***/
|
||||
/**
|
||||
* @function get_role()
|
||||
*
|
||||
* @description This method gets a user role in slug format. e.g. member
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->get_role(); ?>
|
||||
*
|
||||
* @returns The user role's slug.
|
||||
*
|
||||
* @example Do something if the user's role is paid-member
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 12 );
|
||||
|
||||
if ( $ultimatemember->user->get_role() == 'paid-member' ) {
|
||||
// Show this to paid customers
|
||||
} else {
|
||||
// You are a free member
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function get_role() {
|
||||
if (isset($this->profile['role']) && !empty( $this->profile['role'] ) ) {
|
||||
return $this->profile['role'];
|
||||
@@ -358,9 +519,32 @@ class UM_User {
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Get user's role name in UM
|
||||
***/
|
||||
/**
|
||||
* @function get_role_name()
|
||||
*
|
||||
* @description This method is similar to $ultimatemember->user->get_role() but returns the role name instead of slug.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->get_role_name(); ?>
|
||||
*
|
||||
* @returns The user role's name.
|
||||
*
|
||||
* @example Do something if the user's role is Paid Customer
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 12 );
|
||||
|
||||
if ( $ultimatemember->user->get_role_name() == 'Paid Customer' ) {
|
||||
// Show this to paid customers
|
||||
} else {
|
||||
// You are a free member
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function get_role_name() {
|
||||
return $this->profile['role_name'];
|
||||
}
|
||||
@@ -372,9 +556,29 @@ class UM_User {
|
||||
update_user_meta( $this->id, $key, $this->profile[$key] );
|
||||
}
|
||||
|
||||
/***
|
||||
*** @Delete any meta key
|
||||
***/
|
||||
/**
|
||||
* @function delete_meta()
|
||||
*
|
||||
* @description This method can be used to delete user's meta key.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->delete_meta( $key ); ?>
|
||||
*
|
||||
* @param $key (string) (required) The meta field key to remove from user
|
||||
*
|
||||
* @returns This method will not return anything. The specified meta key will be deleted from database for the specified user.
|
||||
*
|
||||
* @example Delete user's age field
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 15 );
|
||||
$ultimatemember->user->delete_meta( 'age' );
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function delete_meta( $key ){
|
||||
delete_user_meta( $this->id, $key );
|
||||
}
|
||||
@@ -414,9 +618,32 @@ class UM_User {
|
||||
return $items;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @If it is a private profile
|
||||
***/
|
||||
/**
|
||||
* @function is_private_profile()
|
||||
*
|
||||
* @description This method checks if give user profile is private.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->is_private_profile( $user_id ); ?>
|
||||
*
|
||||
* @param $user_id (numeric) (required) A user ID must be passed to check if the user profile is private
|
||||
*
|
||||
* @returns Returns true if user profile is private and false if user profile is public.
|
||||
*
|
||||
* @example This example display a specific user's name If his profile is public
|
||||
|
||||
<?php
|
||||
|
||||
um_fetch_user( 60 );
|
||||
$is_private = $ultimatemember->user->is_private_profile( 60 );
|
||||
if ( !$is_private ) {
|
||||
echo 'User is public and his name is ' . um_user('display_name');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function is_private_profile( $user_id ) {
|
||||
$privacy = get_user_meta( $user_id, 'profile_privacy', true );
|
||||
if ( $privacy == __('Only me','ultimatemember') ) {
|
||||
@@ -425,9 +652,32 @@ class UM_User {
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @If it is un-approved profile
|
||||
***/
|
||||
/**
|
||||
* @function is_approved()
|
||||
*
|
||||
* @description This method can be used to determine If a certain user is approved or not.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->is_approved( $user_id ); ?>
|
||||
*
|
||||
* @param $user_id (numeric) (required) The user ID to check approval status for
|
||||
*
|
||||
* @returns True if user is approved and false if user is not approved.
|
||||
*
|
||||
* @example Do something If a user's membership is approved
|
||||
|
||||
<?php
|
||||
|
||||
if ( $ultimatemember->user->is_approved( 55 ) {
|
||||
// User account is approved
|
||||
} else {
|
||||
// User account is not approved
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function is_approved( $user_id ) {
|
||||
$status = get_user_meta( $user_id, 'account_status', true );
|
||||
if ( $status == 'approved' || $status == '' ) {
|
||||
@@ -520,9 +770,31 @@ class UM_User {
|
||||
return false;
|
||||
}
|
||||
|
||||
/***
|
||||
*** @user exists by id
|
||||
***/
|
||||
/**
|
||||
* @function user_exists_by_id()
|
||||
*
|
||||
* @description This method checks if a user exists or not in your site based on the user ID.
|
||||
*
|
||||
* @usage <?php $ultimatemember->user->user_exists_by_id( $user_id ); ?>
|
||||
*
|
||||
* @param $user_id (numeric) (required) A user ID must be passed to check if the user exists
|
||||
*
|
||||
* @returns Returns true if user exists and false if user does not exist.
|
||||
*
|
||||
* @example Basic Usage
|
||||
|
||||
<?php
|
||||
|
||||
$boolean = $ultimatemember->user->user_exists_by_id( 15 );
|
||||
if ( $boolean ) {
|
||||
// That user exists
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
*
|
||||
*
|
||||
*/
|
||||
function user_exists_by_id( $user_id ) {
|
||||
$aux = get_userdata( $user_id );
|
||||
if($aux==false){
|
||||
|
||||
@@ -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: 1.0.76
|
||||
Version: 1.0.77
|
||||
Author: Ultimate Member
|
||||
Author URI: http://ultimatemember.com/
|
||||
*/
|
||||
|
||||
+10
-1
@@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm
|
||||
Requires at least: 4.1
|
||||
Tested up to: 4.1.1
|
||||
|
||||
Stable Tag: 1.0.76
|
||||
Stable Tag: 1.0.77
|
||||
|
||||
License: GNU Version 2 or Any Later Version
|
||||
|
||||
@@ -189,6 +189,15 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.0.77: March 10, 2015 =
|
||||
|
||||
* New: integration with comments to show user profile link instead of user link (not compatible with all themes)
|
||||
* New: option to control maximum size of uploaded profile photo
|
||||
* New: option to control maximum size of uploaded cover photo
|
||||
* Tweak: URL fields will are now treated as hyperlinks
|
||||
* Fixed: bug with member directory privacy option
|
||||
* Fixed: bug with using # as a character in file or image upload
|
||||
|
||||
= 1.0.76: March 7, 2015 =
|
||||
|
||||
* New: added {user_avatar_small} tag to display user photo in menu (requires extra css work)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<div style="padding: 0 30px 30px 30px;border-bottom: 3px solid #eeeeee;">
|
||||
|
||||
<div style="padding: 30px 0;font-size: 24px;text-align: center;line-height: 40px;">Your account is now removed.<span style="display: block;">All your personal details and uploads have been removed.</span></div>
|
||||
<div style="padding: 30px 0;font-size: 24px;text-align: center;line-height: 40px;">Your account has been deleted.<span style="display: block;">All your personal details and any uploads have been permanently removed.</span></div>
|
||||
|
||||
<div style="padding: 15px;background: #eee;border-radius: 3px;text-align: center;">If your account has been deleted by accident please <a href="mailto:{admin_email}" style="color: #3ba1da;text-decoration: none">contact us</a>.</div>
|
||||
|
||||
|
||||
@@ -825,6 +825,22 @@ $this->sections[] = array(
|
||||
'title' => __( 'Uploads','ultimatemember'),
|
||||
'fields' => array(
|
||||
|
||||
array(
|
||||
'id' => 'profile_photo_max_size',
|
||||
'type' => 'text',
|
||||
'title' => __( 'Profile Photo Maximum File Size','ultimatemember' ),
|
||||
'desc' => __( 'Sets a maximum size for the uploaded photo','ultimatemember' ),
|
||||
'validate' => 'numeric',
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'cover_photo_max_size',
|
||||
'type' => 'text',
|
||||
'title' => __( 'Cover Photo Maximum File Size','ultimatemember' ),
|
||||
'desc' => __( 'Sets a maximum size for the uploaded cover','ultimatemember' ),
|
||||
'validate' => 'numeric',
|
||||
),
|
||||
|
||||
array(
|
||||
'id' => 'photo_thumb_sizes',
|
||||
'type' => 'multi_text',
|
||||
|
||||
@@ -119,6 +119,7 @@ class UM_API {
|
||||
require_once um_path . 'core/um-filters-account.php';
|
||||
require_once um_path . 'core/um-filters-misc.php';
|
||||
require_once um_path . 'core/um-filters-addons.php';
|
||||
require_once um_path . 'core/um-filters-commenting.php';
|
||||
|
||||
/* initialize UM */
|
||||
$this->rewrite = new UM_Rewrite();
|
||||
|
||||
Reference in New Issue
Block a user