This commit is contained in:
Yurii Nalivaiko
2018-10-24 10:03:55 +03:00
26 changed files with 687 additions and 384 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ Ultimate Member is the #1 user profile & membership plugin for WordPress. The pl
| Latest Version |Requires at least|Stable Tag|
| :------------: |:------------:|:------------:|
| 2.0.25 | WordPress 4.9 or higher| 2.0.25 |
| 2.0.29 | WordPress 4.9 or higher| 2.0.29 |
Features of the plugin include:
@@ -48,9 +48,7 @@ GNU Version 2 or Any Later Version
Releases
====================
[Official Release Version: 2.0.25](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.25).
[Official Release Version: 1.3.88](https://github.com/ultimatemember/ultimatemember/releases).
[Official Release Version: 2.0.29](https://github.com/ultimatemember/ultimatemember/releases/tag/2.0.29).
Changelog
====================
+56 -25
View File
@@ -241,31 +241,62 @@ jQuery(document).ready(function() {
return false;
});
jQuery(document).on('click', '.um-ajax-paginate', function(e){
e.preventDefault();
var parent = jQuery(this).parent();
parent.addClass('loading');
var args = jQuery(this).data('args');
var hook = jQuery(this).data('hook');
var container = jQuery(this).parents('.um').find('.um-ajax-items');
jQuery.ajax({
url: wp.ajax.settings.url,
type: 'post',
data: {
action: 'um_ajax_paginate',
hook: hook,
args: args
},
complete: function(){
parent.removeClass('loading');
},
success: function(data){
parent.remove();
container.append( data );
}
});
return false;
});
jQuery( document.body ).on( 'click', '.um-ajax-paginate', function(e) {
e.preventDefault();
var obj = jQuery(this);
var parent = jQuery(this).parent();
parent.addClass( 'loading' );
var hook = jQuery(this).data('hook');
if ( 'um_load_posts' === hook ) {
var pages = jQuery(this).data('pages')*1;
var next_page = jQuery(this).data('page')*1 + 1;
jQuery.ajax({
url: wp.ajax.settings.url,
type: 'post',
data: {
action: 'um_ajax_paginate_posts',
author: jQuery(this).data('author'),
page: next_page
},
complete: function() {
parent.removeClass( 'loading' );
},
success: function( data ) {
parent.before( data );
if ( next_page === pages ) {
parent.remove();
} else {
obj.data( 'page', next_page );
}
}
});
} else {
var args = jQuery(this).data('args');
var container = jQuery(this).parents('.um').find('.um-ajax-items');
jQuery.ajax({
url: wp.ajax.settings.url,
type: 'post',
data: {
action: 'um_ajax_paginate',
hook: hook,
args: args
},
complete: function() {
parent.removeClass( 'loading' );
},
success: function(data){
parent.remove();
container.append( data );
}
});
}
});
jQuery(document).on('click', '.um-ajax-action', function(e){
e.preventDefault();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -57,7 +57,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Load js for Add/Edit User form
*/
function load_role_wrapper() {
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', '', '', true );
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', '', ultimatemember_version, true );
wp_enqueue_script( 'um_admin_role_wrapper' );
$localize_roles_data = get_option( 'um_roles' );
+1 -1
View File
@@ -631,7 +631,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
return;
}
if ( $first_activation_date + MONTH_IN_SECONDS > time() ) {
if ( $first_activation_date + 2*WEEK_IN_SECONDS > time() ) {
return;
}
+10 -1
View File
@@ -78,6 +78,15 @@
'add_text' => __( 'Add New Custom Field','ultimate-member' ),
'show_default_number' => 1,
),
array(
'id' => '_um_search_filters',
'type' => 'text',
'label' => __( 'Additional search filters', 'ultimate-member' ),
'tooltip' => __( 'Additional search filters like URL parameters' ),
'value' => UM()->query()->get_meta_value('_um_search_filters', null, '' ),
'conditional' => array( '_um_search', '=', 1 ),
'placeholder' => 'field1=val1&field2=val2'
),
array(
'id' => '_um_directory_header',
'type' => 'text',
@@ -104,6 +113,6 @@
)
)
) )->render_form(); ?>
<div class="um-admin-clear"></div>
</div>
+15 -1
View File
@@ -117,7 +117,21 @@ $premium['private-content'] = array(
'url' => 'https://ultimatemember.com/extensions/private-content/',
'image' => 'https://ultimatemember.com/wp-content/uploads/bb-plugin/cache/private-content-page-circle.png',
'name' => 'Private Content',
'desc' => 'With the private content extension you can provide logged in users with content that only they can access and view',
'desc' => 'Display private content to logged in users that only they can access',
);
$premium['groups'] = array(
'url' => 'https://ultimatemember.com/extensions/groups/',
'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/10/groupimage.png',
'name' => 'Groups',
'desc' => 'Allow users to create and join groups around shared topics, interests etc.',
);
$premium['user-photos'] = array(
'url' => 'https://ultimatemember.com/extensions/user-photos/',
'image' => 'https://ultimatemember.com/wp-content/uploads/edd/2018/06/User-Photos.png',
'name' => 'User Photos',
'desc' => 'Allow users to upload photos to their profile',
);
+1
View File
@@ -149,6 +149,7 @@ if ( ! class_exists( 'um\Config' ) ) {
'_um_profile_photo' => '1',
'_um_cover_photos' => '1',
'_um_show_name' => '1',
'_um_search_filters' => '',
'_um_directory_header' => __('{total_users} Members','ultimate-member'),
'_um_directory_header_single' => __('{total_users} Member','ultimate-member'),
'_um_directory_no_users' => __('We are sorry. We cannot find any users who match your search criteria.','ultimate-member'),
+1
View File
@@ -31,6 +31,7 @@ if ( ! class_exists( 'UM' ) ) {
* @method UM_Private_Content_API Private_Content_API()
* @method UM_User_Location_API User_Location_API()
* @method UM_Photos_API Photos_API()
* @method UM_Groups Groups()
*
*/
final class UM extends UM_Functions {
+3
View File
@@ -36,7 +36,10 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
add_action( 'wp_ajax_um_delete_profile_photo', array( UM()->profile(), 'ajax_delete_profile_photo' ) );
add_action( 'wp_ajax_um_delete_cover_photo', array( UM()->profile(), 'ajax_delete_cover_photo' ) );
add_action( 'wp_ajax_um_ajax_paginate', array( UM()->query(), 'ajax_paginate' ) );
add_action( 'wp_ajax_um_ajax_paginate_posts', array( UM()->user_posts(), 'load_posts' ) );
add_action( 'wp_ajax_um_muted_action', array( UM()->form(), 'ajax_muted_action' ) );
add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) );
+7
View File
@@ -2313,6 +2313,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
} else {
$file_url = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
$file_dir = UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $this->field_value( $key, $default, $data );
if ( ! file_exists( $file_dir ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$file_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_dir );
}
}
}
if ( file_exists( $file_dir ) ) {
+29 -12
View File
@@ -100,18 +100,19 @@ if ( ! class_exists( 'um\core\Files' ) ) {
return false;
}
if ( empty( get_query_var( 'um_form' ) ) ) {
$query_form = get_query_var( 'um_form' );
if ( empty( $query_form ) ) {
return false;
}
$form_id = get_query_var( 'um_form' );
if ( empty( get_query_var( 'um_field' ) ) ) {
$query_field = get_query_var( 'um_field' );
if ( empty( $query_field ) ) {
return false;
}
$field_key = urldecode( get_query_var( 'um_field' ) );
if ( empty( get_query_var( 'um_user' ) ) ) {
$query_user = get_query_var( 'um_user' );
if ( empty( $query_user ) ) {
return false;
}
@@ -121,9 +122,9 @@ if ( ! class_exists( 'um\core\Files' ) ) {
if ( empty( $user ) || is_wp_error( $user ) ) {
return false;
}
if ( empty( get_query_var( 'um_verify' ) ) ||
! wp_verify_nonce( get_query_var( 'um_verify' ), $user_id . $form_id . 'um-download-nonce' ) ) {
$query_verify = get_query_var( 'um_verify' );
if ( empty( $query_verify ) ||
! wp_verify_nonce( $query_verify, $user_id . $form_id . 'um-download-nonce' ) ) {
return false;
}
@@ -160,11 +161,19 @@ if ( ! class_exists( 'um\core\Files' ) ) {
*/
function image_download( $user_id, $field_key, $field_value ) {
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
if ( ! file_exists( $file_path ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
}
}
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
$pathinfo = pathinfo( $file_path );
$size = filesize( $file_path );
$originalname = $file_info['original_name'];
$type = $file_info['type'];
$originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
$type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
header('Content-Description: File Transfer');
header('Content-Type: ' . $type );
@@ -186,11 +195,19 @@ if ( ! class_exists( 'um\core\Files' ) ) {
*/
function file_download( $user_id, $field_key, $field_value ) {
$file_path = UM()->uploader()->get_upload_base_dir() . $user_id . DIRECTORY_SEPARATOR . $field_value;
if ( ! file_exists( $file_path ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $file_path );
}
}
$file_info = get_user_meta( $user_id, $field_key . "_metadata", true );
$pathinfo = pathinfo( $file_path );
$size = filesize( $file_path );
$originalname = $file_info['original_name'];
$type = $file_info['type'];
$originalname = ! empty( $file_info['original_name'] ) ? $file_info['original_name'] : $pathinfo['basename'];
$type = ! empty( $file_info['type'] ) ? $file_info['type'] : $pathinfo['extension'];
header('Content-Description: File Transfer');
header('Content-Type: ' . $type );
-3
View File
@@ -272,14 +272,11 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
$file = um_path . "templates/{$tpl}.php";
$theme_file = get_stylesheet_directory() . "/ultimate-member/templates/{$tpl}.php";
if ( file_exists( $theme_file ) ) {
$file = $theme_file;
}
if ( file_exists( $file ) ) {
include $file;
}
}
+91 -30
View File
@@ -20,32 +20,109 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
add_action( 'um_profile_content_posts', array( &$this, 'add_posts' ) );
add_action( 'um_profile_content_comments', array( &$this, 'add_comments' ) );
add_action( 'um_ajax_load_posts__um_load_posts', array( &$this, 'load_posts' ) );
add_action( 'um_ajax_load_posts__um_load_comments', array( &$this, 'load_comments' ) );
add_action( 'um_ajax_load_posts__um_load_comments', array( &$this, 'load_comments' ), 10, 1 );
}
/**
* Add posts
*/
function add_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => 0,
'author' => um_get_requested_user(),
'post_status' => array( 'publish' )
);
/**
* UM hook
*
* @type filter
* @title um_profile_query_make_posts
* @description Some changes of WP_Query Posts Tab
* @input_vars
* [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
* @change_log
* ["Since: 2.0"]
* @usage
* <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
* @example
* <?php
* add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
* function my_profile_query_make_posts( $query_posts ) {
* // your code here
* return $query_posts;
* }
* ?>
*/
$args = apply_filters( 'um_profile_query_make_posts', $args );
$posts = get_posts( $args );
$count_posts = wp_count_posts();
$count_posts = ! empty( $count_posts->publish ) ? $count_posts->publish : 0;
UM()->shortcodes()->set_args = array( 'posts' => $posts, 'count_posts' => $count_posts );
UM()->shortcodes()->load_template( 'profile/posts' );
}
/**
* Add comments
*/
function add_comments() {
UM()->shortcodes()->load_template( 'profile/comments' );
}
/**
* Dynamic load of posts
*
* @param array $args
*/
function load_posts( $args ) {
$array = explode(',', $args );
$post_type = $array[0];
$posts_per_page = $array[1];
$offset = $array[2];
$author = $array[3];
function load_posts() {
$author = ! empty( $_POST['author'] ) ? $_POST['author'] : get_current_user_id();
$page = ! empty( $_POST['page'] ) ? $_POST['page'] : 0;
$offset_n = $posts_per_page + $offset;
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => ( $page - 1 ) * 10,
'author' => $author,
'post_status' => array( 'publish' )
);
UM()->shortcodes()->modified_args = "$post_type,$posts_per_page,$offset_n,$author";
/**
* UM hook
*
* @type filter
* @title um_profile_query_make_posts
* @description Some changes of WP_Query Posts Tab
* @input_vars
* [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
* @change_log
* ["Since: 2.0"]
* @usage
* <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
* @example
* <?php
* add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
* function my_profile_query_make_posts( $query_posts ) {
* // your code here
* return $query_posts;
* }
* ?>
*/
$args = apply_filters( 'um_profile_query_make_posts', $args );
$posts = get_posts( $args );
UM()->shortcodes()->loop = UM()->query()->make("post_type=$post_type&posts_per_page=$posts_per_page&offset=$offset&author=$author");
UM()->shortcodes()->load_template('profile/posts-single');
UM()->shortcodes()->set_args = array( 'posts' => $posts );
UM()->shortcodes()->load_template( 'profile/posts' );
wp_die();
}
/**
* Dynamic load of comments
*
@@ -68,22 +145,6 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
}
/**
* Add posts
*/
function add_posts() {
UM()->shortcodes()->load_template( 'profile/posts' );
}
/**
* Add comments
*/
function add_comments() {
UM()->shortcodes()->load_template( 'profile/comments' );
}
/**
* Count posts by type
*
+6 -4
View File
@@ -1214,12 +1214,14 @@ if ( ! class_exists( 'um\core\User' ) ) {
?>
*
*/
function approve() {
function approve( $repeat = true ) {
$user_id = um_user('ID');
$status = get_user_meta( $user_id, 'account_status', true );
if ( 'approved' === $status ) {
return;
if ( ! $repeat ) {
$status = get_user_meta( $user_id, 'account_status', true );
if ( 'approved' === $status ) {
return;
}
}
delete_option( "um_cache_userdata_{$user_id}" );
+23 -18
View File
@@ -47,16 +47,18 @@ function um_submit_form_errors_hook_login( $args ) {
$user_name = $args['user_login'];
}
if ( !username_exists( $user_name ) ) {
/*if ( !username_exists( $user_name ) ) {
if ( $is_email ) {
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that email address','ultimate-member') );
} else {
UM()->form()->add_error( $field, __(' Sorry, we can\'t find an account with that username','ultimate-member') );
}
} else {
if ( $args['user_password'] == '' ) {
UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
}
}*/
if ( $args['user_password'] == '' ) {
UM()->form()->add_error( 'user_password', __('Please enter your password','ultimate-member') );
}
$user = get_user_by( 'login', $user_name );
@@ -100,26 +102,29 @@ add_action( 'um_submit_form_errors_hook_login', 'um_submit_form_errors_hook_logi
*/
function um_display_login_errors( $args ) {
$error = '';
if( UM()->form()->count_errors() > 0 ) {
if ( UM()->form()->count_errors() > 0 ) {
$errors = UM()->form()->errors;
// hook for other plugins to display error
$error_keys = array_keys( $errors );
}
}
if( isset( $args['custom_fields'] ) ){
$custom_fields = $args['custom_fields'];
}
if ( isset( $args['custom_fields'] ) ) {
$custom_fields = $args['custom_fields'];
}
if( ! empty( $error_keys ) && ! empty( $custom_fields ) ){
foreach( $error_keys as $error ){
if( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ){
$error_message = apply_filters( 'login_errors', $errors[ $error ] );
echo '<p class="um-notice err um-error-code-'.$error.'"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
if ( ! empty( $error_keys ) && ! empty( $custom_fields ) ) {
foreach ( $error_keys as $error ) {
if ( trim( $error ) && ! isset( $custom_fields[ $error ] ) && ! empty( $errors[ $error ] ) ) {
$error_message = apply_filters( 'login_errors', $errors[ $error ], $error );
if ( empty( $error_message ) ) {
return;
}
echo '<p class="um-notice err um-error-code-' . esc_attr( $error ) . '"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>' . $error_message . '</p>';
}
}
}
}
add_action( 'um_before_login_fields', 'um_display_login_errors' );
@@ -421,12 +426,12 @@ function um_add_submit_button_to_login( $args ) {
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
<div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
<div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
<div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $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"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
<?php } else { ?>
<div class="um-center"><input type="submit" value="<?php echo __( $args['primary_btn_word'],'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
<div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'],'ultimate-member' ); ?>" class="um-button" id="um-submit-btn" /></div>
<?php } ?>
+4 -4
View File
@@ -1195,15 +1195,15 @@ function um_add_submit_button_to_profile( $args ) {
<?php if (isset( $args['secondary_btn'] ) && $args['secondary_btn'] != 0) { ?>
<div class="um-left um-half"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
<div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
class="um-button"/></div>
<div class="um-right um-half"><a href="<?php echo um_edit_my_profile_cancel_uri(); ?>"
class="um-button um-alt"><?php echo $args['secondary_btn_word']; ?></a>
<div class="um-right um-half"><a href="<?php echo esc_attr( um_edit_my_profile_cancel_uri() ); ?>"
class="um-button um-alt"><?php esc_attr_e( $args['secondary_btn_word'], 'ultimate-member' ); ?></a>
</div>
<?php } else { ?>
<div class="um-center"><input type="submit" value="<?php echo $args['primary_btn_word']; ?>"
<div class="um-center"><input type="submit" value="<?php esc_attr_e( $args['primary_btn_word'], 'ultimate-member' ); ?>"
class="um-button"/></div>
<?php } ?>
+3 -3
View File
@@ -585,12 +585,12 @@ function um_add_submit_button_to_register( $args ) {
<?php if ( isset($args['secondary_btn']) && $args['secondary_btn'] != 0 ) { ?>
<div class="um-left um-half"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
<div class="um-right um-half"><a href="<?php echo $secondary_btn_url; ?>" class="um-button um-alt"><?php echo __( $secondary_btn_word,'ultimate-member'); ?></a></div>
<div class="um-left um-half"><input type="submit" value="<?php esc_attr_e( $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"><?php esc_attr_e( $secondary_btn_word,'ultimate-member'); ?></a></div>
<?php } else { ?>
<div class="um-center"><input type="submit" value="<?php echo __( $primary_btn_word,'ultimate-member'); ?>" class="um-button" id="um-submit-btn" /></div>
<div class="um-center"><input type="submit" value="<?php esc_attr_e( $primary_btn_word,'ultimate-member' ) ?>" class="um-button" id="um-submit-btn" /></div>
<?php } ?>
+47 -1
View File
@@ -226,7 +226,20 @@ function um_profile_field_filter_hook__file( $value, $data ) {
$file_type = wp_check_filetype( $value );
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
$removed = false;
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
if ( ! file_exists( $file_path ) ) {
$removed = true;
}
} else {
$removed = true;
}
}
if ( $removed ) {
$value = __( 'This file has been removed.', 'ultimate-member' );
} else {
$file_info = um_user( $data['metakey'] . "_metadata" );
@@ -260,11 +273,24 @@ function um_profile_field_filter_hook__image( $value, $data ) {
$uri = UM()->files()->get_download_link( UM()->fields()->set_id, $data['metakey'], um_user( 'ID' ) );
$title = ( isset( $data['title'] ) ) ? $data['title'] : __( 'Untitled photo', 'ultimate-member' );
$removed = false;
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$file_path = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value );
if ( ! file_exists( $file_path ) ) {
$removed = true;
}
} else {
$removed = true;
}
}
// if value is an image tag
if( preg_match( '/\<img.*src=\"([^"]+).*/', $value, $matches ) ) {
$uri = $matches[1];
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
} else if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $value ) ) {
} else if ( ! $removed ) {
$value = '<div class="um-photo"><a href="#" class="um-photo-modal" data-src="' . esc_attr( $uri ) . '"><img src="' . esc_attr( $uri ) . '" alt="' . esc_attr( $title ) . '" title="' . esc_attr( $title ) . '" class="" /></a></div>';
} else {
$value = '';
@@ -637,6 +663,26 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
add_filter( 'um_profile_field_filter_hook__','um_profile_field_filter_xss_validation', 10, 3 );
/**
* Trim All form POST submitted data
*
* @param $post_form
* @param $mode
*
* @return mixed
*/
function um_submit_form_data_trim_fields( $post_form, $mode ) {
foreach ( $post_form as $key => $field ) {
if ( is_string( $field ) ) {
$post_form[ $key ] = trim( $field );
}
}
return $post_form;
}
add_filter( 'um_submit_form_data', 'um_submit_form_data_trim_fields', 9, 2 );
/**
* add role_select and role_radio to the $post_form
* It is necessary for that if on these fields the conditional logic
+19 -6
View File
@@ -100,18 +100,31 @@ add_filter( 'um_prepare_user_query_args', 'um_remove_special_users_from_list', 9
/**
* Adds search parameters
*
* @hooked 'um_prepare_user_query_args'
*
* @param $query_args
* @param $args
*
* @return mixed|void
*/
function um_add_search_to_query( $query_args, $args ){
function um_add_search_to_query( $query_args, $args ) {
extract( $args );
if ( ! empty( $args['search_filters'] ) ) {
$_REQUEST['um_search'] = 1;
}
if ( isset( $_REQUEST['um_search'] ) ) {
$query = UM()->permalinks()->get_query_array();
if ( ! empty( $args['search_filters'] ) ) {
parse_str( $args['search_filters'], $search_filters );
if ( $search_filters && is_array( $search_filters ) ) {
$query = array_merge( $search_filters, $query );
}
}
// if searching
if ( isset( $query['search'] ) ) {
$query_args['search'] = '*' . um_filter_search( $query['search'] ) . '*';
@@ -154,7 +167,7 @@ function um_add_search_to_query( $query_args, $args ){
) );
if ( in_array( $filter_data['attrs']['type'], $types ) ) {
$arr_meta_query = array(
array(
'key' => $field,
@@ -383,7 +396,7 @@ function um_prepare_user_query_args( $query_args, $args ) {
$sortby = str_replace('_asc','',$sortby);
$order = 'ASC';
}
$query_args['orderby'] = $sortby;
}
@@ -469,14 +482,14 @@ function um_modify_sortby_randomly( $query ) {
if( isset( $_SESSION['seed'] ) ) {
$seed = $_SESSION['seed'];
}
// Set new seed if none exists
if ( ! $seed ) {
$seed = rand();
$_SESSION['seed'] = $seed;
}
$query->query_orderby = 'ORDER by RAND('. $seed.')';
}
@@ -498,7 +511,7 @@ function um_prepare_user_results_array( $result ) {
} else {
$result['no_users'] = 0;
}
return $result;
}
add_filter( 'um_prepare_user_results_array', 'um_prepare_user_results_array', 50, 2 );
+92 -23
View File
@@ -556,10 +556,19 @@ function um_user_submitted_registration( $style = false ) {
if ( UM()->fields()->get_field_type( $k ) == 'image' || UM()->fields()->get_field_type( $k ) == 'file' ) {
$file = basename( $v );
$filedata = get_user_meta( um_user( 'ID' ), $k . "_metadata", true );
$baseurl = UM()->uploader()->get_upload_base_url();
if ( ! file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . $file ) ) {
if ( is_multisite() ) {
//multisite fix for old customers
$baseurl = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $baseurl );
}
}
if ( ! empty( $filedata['original_name'] ) ) {
$v = '<a href="' . esc_attr( UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
$v = '<a href="' . esc_attr( $baseurl . um_user( 'ID' ) . '/' . $file ) . '">' . $filedata['original_name'] . '</a>';
} else {
$v = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $file;
$v = $baseurl . um_user( 'ID' ) . '/' . $file;
}
}
@@ -1659,8 +1668,27 @@ function um_closest_num( $array, $number ) {
*/
function um_get_cover_uri( $image, $attrs ) {
$uri = false;
$uri_common = false;
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
if ( is_multisite() ) {
//multisite fix for old customers
$multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
$multisite_fix_url = UM()->uploader()->get_upload_base_url();
$multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
$multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
}
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}x{$attrs}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}x{$attrs}{$ext}?". current_time( 'timestamp' );
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
}
}
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo{$ext}?" . current_time( 'timestamp' );
}
@@ -1670,6 +1698,11 @@ function um_get_cover_uri( $image, $attrs ) {
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "cover_photo-{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/cover_photo-{$attrs}{$ext}?" . current_time( 'timestamp' );
}
if ( ! empty( $uri_common ) && empty( $uri ) ) {
$uri = $uri_common;
}
return $uri;
}
@@ -1699,8 +1732,64 @@ function um_get_avatar_url( $get_avatar ) {
*/
function um_get_avatar_uri( $image, $attrs ) {
$uri = false;
$uri_common = false;
$find = false;
$ext = '.' . pathinfo( $image, PATHINFO_EXTENSION );
if ( is_multisite() ) {
//multisite fix for old customers
$multisite_fix_dir = UM()->uploader()->get_upload_base_dir();
$multisite_fix_url = UM()->uploader()->get_upload_base_url();
$multisite_fix_dir = str_replace( DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR . get_current_blog_id() . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $multisite_fix_dir );
$multisite_fix_url = str_replace( '/sites/' . get_current_blog_id() . '/', '/', $multisite_fix_url );
if ( $attrs == 'original' && file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
} else {
$sizes = UM()->options()->get( 'photo_thumb_sizes' );
if ( is_array( $sizes ) ) {
$find = um_closest_num( $sizes, $attrs );
}
if ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
} elseif ( file_exists( $multisite_fix_dir . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri_common = $multisite_fix_url . um_user( 'ID' ) . "/profile_photo{$ext}";
}
}
}
if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
} else {
$sizes = UM()->options()->get( 'photo_thumb_sizes' );
if ( is_array( $sizes ) ) {
$find = um_closest_num( $sizes, $attrs );
}
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
}
}
if ( ! empty( $uri_common ) && empty( $uri ) ) {
$uri = $uri_common;
}
/**
* UM hook
*
@@ -1723,30 +1812,10 @@ function um_get_avatar_uri( $image, $attrs ) {
* ?>
*/
$cache_time = apply_filters( 'um_filter_avatar_cache_time', current_time( 'timestamp' ), um_user( 'ID' ) );
if ( $attrs == 'original' && file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}x{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}x{$attrs}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$attrs}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$attrs}{$ext}";
} else {
$sizes = UM()->options()->get( 'photo_thumb_sizes' );
if ( is_array( $sizes ) ) {
$find = um_closest_num( $sizes, $attrs );
}
if ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}x{$find}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}x{$find}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo-{$find}{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo-{$find}{$ext}";
} elseif ( file_exists( UM()->uploader()->get_upload_base_dir() . um_user( 'ID' ) . DIRECTORY_SEPARATOR . "profile_photo{$ext}" ) ) {
$uri = UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/profile_photo{$ext}";
}
}
if ( ! empty( $cache_time ) ) {
$uri .= "?{$cache_time}";
}
return $uri;
}
+176 -176
View File
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Ultimate Member\n"
"POT-Creation-Date: 2018-09-18 09:44+0300\n"
"PO-Revision-Date: 2018-09-18 09:45+0300\n"
"POT-Creation-Date: 2018-10-08 23:32+0300\n"
"PO-Revision-Date: 2018-10-08 23:32+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en_US\n"
@@ -94,62 +94,62 @@ msgstr ""
msgid "Reset all rules"
msgstr ""
#: includes/admin/core/class-admin-builder.php:402
#: includes/admin/core/class-admin-builder.php:472
#: includes/admin/core/class-admin-builder.php:401
#: includes/admin/core/class-admin-builder.php:471
#: includes/admin/core/class-admin-dragdrop.php:161
msgid "Add Row"
msgstr ""
#: includes/admin/core/class-admin-builder.php:403
#: includes/admin/core/class-admin-builder.php:473
#: includes/admin/core/class-admin-builder.php:402
#: includes/admin/core/class-admin-builder.php:472
#: includes/admin/core/class-admin-dragdrop.php:162
msgid "Edit Row"
msgstr ""
#: includes/admin/core/class-admin-builder.php:476
#: includes/admin/core/class-admin-builder.php:475
#: includes/admin/core/class-admin-dragdrop.php:164
#: includes/admin/core/class-admin-dragdrop.php:178
#: includes/admin/core/class-admin-dragdrop.php:203
msgid "Delete Row"
msgstr ""
#: includes/admin/core/class-admin-builder.php:610
#: includes/admin/core/class-admin-builder.php:764
#: includes/core/class-fields.php:4034
#: includes/admin/core/class-admin-builder.php:609
#: includes/admin/core/class-admin-builder.php:763
#: includes/core/class-fields.php:4033
msgid "Please login as administrator"
msgstr ""
#: includes/admin/core/class-admin-builder.php:830
#: includes/admin/core/class-admin-builder.php:827
msgid "Search Icons..."
msgstr ""
#: includes/admin/core/class-admin-builder.php:851
#: includes/admin/core/class-admin-builder.php:847
msgid "Setup New Field"
msgstr ""
#: includes/admin/core/class-admin-builder.php:867
#: includes/admin/core/class-admin-builder.php:863
msgid "Predefined Fields"
msgstr ""
#: includes/admin/core/class-admin-builder.php:878
#: includes/admin/core/class-admin-builder.php:874
#: includes/core/class-builtin.php:1308
msgid "None"
msgstr ""
#: includes/admin/core/class-admin-builder.php:882
#: includes/admin/core/class-admin-builder.php:878
msgid "Custom Fields"
msgstr ""
#: includes/admin/core/class-admin-builder.php:893
#: includes/admin/core/class-admin-builder.php:889
msgid "You did not create any custom fields"
msgstr ""
#: includes/admin/core/class-admin-builder.php:925
#: includes/admin/core/class-admin-builder.php:999
#: includes/admin/core/class-admin-builder.php:920
#: includes/admin/core/class-admin-builder.php:992
msgid "This field type is not setup correcty."
msgstr ""
#: includes/admin/core/class-admin-builder.php:1146
#: includes/admin/core/class-admin-builder.php:1137
#: includes/core/class-form.php:153 includes/core/class-form.php:326
#: includes/core/class-password.php:518
msgid "This is not possible for security reasons."
@@ -188,10 +188,10 @@ msgstr ""
#: includes/admin/core/class-admin-enqueue.php:127
#: includes/admin/core/class-admin-enqueue.php:161
#: includes/admin/core/class-admin-forms.php:814
#: includes/admin/core/class-admin-forms.php:828
#: includes/admin/core/class-admin-forms.php:933
#: includes/admin/core/class-admin-forms.php:942
#: includes/admin/core/class-admin-forms.php:813
#: includes/admin/core/class-admin-forms.php:827
#: includes/admin/core/class-admin-forms.php:932
#: includes/admin/core/class-admin-forms.php:941
#: includes/admin/core/class-admin-notices.php:430
#: includes/core/um-actions-profile.php:553
msgid "Remove"
@@ -199,7 +199,7 @@ msgstr ""
#: includes/admin/core/class-admin-enqueue.php:128
#: includes/admin/core/class-admin-enqueue.php:162
#: includes/admin/core/class-admin-forms.php:1010
#: includes/admin/core/class-admin-forms.php:1009
msgid "Select"
msgstr ""
@@ -215,11 +215,11 @@ msgstr ""
msgid "No Icon"
msgstr ""
#: includes/admin/core/class-admin-forms.php:987
#: includes/admin/core/class-admin-forms.php:986
msgid "Select media"
msgstr ""
#: includes/admin/core/class-admin-forms.php:1011
#: includes/admin/core/class-admin-forms.php:1010
msgid "Clear"
msgstr ""
@@ -1534,7 +1534,7 @@ msgid ""
msgstr ""
#: includes/admin/core/class-admin-settings.php:338
#: includes/class-config.php:134 includes/class-config.php:738
#: includes/class-config.php:134 includes/class-config.php:739
#: includes/core/class-account.php:90
msgid "Account"
msgstr ""
@@ -2482,7 +2482,7 @@ msgid "UM Action"
msgstr ""
#: includes/admin/core/class-admin-users.php:116
#: includes/core/class-fields.php:2276
#: includes/core/class-fields.php:2271
msgid "Apply"
msgstr ""
@@ -3129,44 +3129,52 @@ msgid "Choose field(s) to enable in search"
msgstr ""
#: includes/admin/templates/directory/search.php:84
msgid "Results Text"
msgid "Additional search filters"
msgstr ""
#: includes/admin/templates/directory/search.php:85
msgid "Additional search filters like URL parameters"
msgstr ""
#: includes/admin/templates/directory/search.php:93
msgid "Results Text"
msgstr ""
#: includes/admin/templates/directory/search.php:94
msgid ""
"Customize the search result text . e.g. Found 3,000 Members. Leave this "
"blank to not show result text"
msgstr ""
#: includes/admin/templates/directory/search.php:86
#: includes/class-config.php:152 includes/class-config.php:247
#: includes/admin/templates/directory/search.php:95
#: includes/class-config.php:153 includes/class-config.php:248
msgid "{total_users} Members"
msgstr ""
#: includes/admin/templates/directory/search.php:92
#: includes/admin/templates/directory/search.php:101
msgid "Single Result Text"
msgstr ""
#: includes/admin/templates/directory/search.php:93
#: includes/admin/templates/directory/search.php:102
msgid "Same as above but in case of 1 user found only"
msgstr ""
#: includes/admin/templates/directory/search.php:94
#: includes/class-config.php:153 includes/class-config.php:248
#: includes/admin/templates/directory/search.php:103
#: includes/class-config.php:154 includes/class-config.php:249
msgid "{total_users} Member"
msgstr ""
#: includes/admin/templates/directory/search.php:100
#: includes/admin/templates/directory/search.php:109
msgid "Custom text if no users were found"
msgstr ""
#: includes/admin/templates/directory/search.php:101
#: includes/admin/templates/directory/search.php:110
msgid ""
"This is the text that is displayed if no users are found during a search"
msgstr ""
#: includes/admin/templates/directory/search.php:102
#: includes/class-config.php:154
#: includes/admin/templates/directory/search.php:111
#: includes/class-config.php:155
msgid "We are sorry. We cannot find any users who match your search criteria."
msgstr ""
@@ -3518,7 +3526,7 @@ msgstr ""
#: includes/admin/templates/modal/dynamic_new_group.php:14
#: includes/admin/templates/modal/fonticons.php:11
#: includes/admin/templates/role/publish.php:24
#: includes/core/class-fields.php:2277 includes/core/class-fields.php:2367
#: includes/core/class-fields.php:2272 includes/core/class-fields.php:2369
#: includes/core/um-actions-profile.php:554
#: includes/core/um-actions-profile.php:693
#: includes/core/um-actions-profile.php:726
@@ -3867,145 +3875,145 @@ msgstr ""
msgid "Check All"
msgstr ""
#: includes/class-config.php:129 includes/class-config.php:733
#: includes/class-config.php:129 includes/class-config.php:734
msgid "User"
msgstr ""
#: includes/class-config.php:130 includes/class-config.php:234
#: includes/class-config.php:240 includes/class-config.php:734
#: includes/class-config.php:130 includes/class-config.php:235
#: includes/class-config.php:241 includes/class-config.php:735
msgid "Login"
msgstr ""
#: includes/class-config.php:131 includes/class-config.php:232
#: includes/class-config.php:244 includes/class-config.php:735
#: includes/class-config.php:131 includes/class-config.php:233
#: includes/class-config.php:245 includes/class-config.php:736
msgid "Register"
msgstr ""
#: includes/class-config.php:132 includes/class-config.php:736
#: includes/class-config.php:132 includes/class-config.php:737
msgid "Members"
msgstr ""
#: includes/class-config.php:133 includes/class-config.php:737
#: includes/class-config.php:133 includes/class-config.php:738
#: includes/core/um-actions-profile.php:1079
#: includes/core/um-actions-user.php:15
msgid "Logout"
msgstr ""
#: includes/class-config.php:135 includes/class-config.php:739
#: includes/class-config.php:135 includes/class-config.php:740
msgid "Password Reset"
msgstr ""
#: includes/class-config.php:307
#: includes/class-config.php:308
msgid "Account Welcome Email"
msgstr ""
#: includes/class-config.php:318
#: includes/class-config.php:319
msgid ""
"Whether to send the user an email when his account is automatically approved"
msgstr ""
#: includes/class-config.php:324
#: includes/class-config.php:325
msgid "Account Activation Email"
msgstr ""
#: includes/class-config.php:332
#: includes/class-config.php:333
msgid ""
"Whether to send the user an email when his account needs e-mail activation"
msgstr ""
#: includes/class-config.php:337
#: includes/class-config.php:338
msgid "Your account is pending review"
msgstr ""
#: includes/class-config.php:345
#: includes/class-config.php:346
msgid "Whether to send the user an email when his account needs admin review"
msgstr ""
#: includes/class-config.php:350
#: includes/class-config.php:351
msgid "Account Approved Email"
msgstr ""
#: includes/class-config.php:362
#: includes/class-config.php:363
msgid "Whether to send the user an email when his account is approved"
msgstr ""
#: includes/class-config.php:367
#: includes/class-config.php:368
msgid "Account Rejected Email"
msgstr ""
#: includes/class-config.php:374
#: includes/class-config.php:375
msgid "Whether to send the user an email when his account is rejected"
msgstr ""
#: includes/class-config.php:379
#: includes/class-config.php:380
msgid "Account Deactivated Email"
msgstr ""
#: includes/class-config.php:386
#: includes/class-config.php:387
msgid "Whether to send the user an email when his account is deactivated"
msgstr ""
#: includes/class-config.php:392
#: includes/class-config.php:393
msgid "Account Deleted Email"
msgstr ""
#: includes/class-config.php:399
#: includes/class-config.php:400
msgid "Whether to send the user an email when his account is deleted"
msgstr ""
#: includes/class-config.php:405
#: includes/class-config.php:406
msgid "Password Reset Email"
msgstr ""
#: includes/class-config.php:413
#: includes/class-config.php:414
msgid ""
"Whether to send an email when users changed their password (Recommended, "
"please keep on)"
msgstr ""
#: includes/class-config.php:419
#: includes/class-config.php:420
msgid "Password Changed Email"
msgstr ""
#: includes/class-config.php:426
#: includes/class-config.php:427
msgid ""
"Whether to send the user an email when he request to reset password "
"(Recommended, please keep on)"
msgstr ""
#: includes/class-config.php:432
#: includes/class-config.php:433
msgid "Account Updated Email"
msgstr ""
#: includes/class-config.php:439
#: includes/class-config.php:440
msgid "Whether to send the user an email when he updated their account"
msgstr ""
#: includes/class-config.php:445
#: includes/class-config.php:446
msgid "New User Notification"
msgstr ""
#: includes/class-config.php:451
#: includes/class-config.php:452
msgid "Whether to receive notification when a new user account is approved"
msgstr ""
#: includes/class-config.php:457
#: includes/class-config.php:458
msgid "Account Needs Review Notification"
msgstr ""
#: includes/class-config.php:464
#: includes/class-config.php:465
msgid "Whether to receive notification when an account needs admin review"
msgstr ""
#: includes/class-config.php:469
#: includes/class-config.php:470
msgid "Account Deletion Notification"
msgstr ""
#: includes/class-config.php:472
#: includes/class-config.php:473
msgid "Whether to receive notification when an account is deleted"
msgstr ""
#: includes/class-config.php:495
#: includes/class-config.php:496
msgid ""
"Are you sure you want to delete your account? This will erase all of your "
"account data from the site. To delete your account enter your password below"
@@ -4045,7 +4053,7 @@ msgstr ""
msgid "Correct folder name is <strong>\"%s\"</strong>"
msgstr ""
#: includes/class-init.php:159 includes/class-init.php:168
#: includes/class-init.php:160 includes/class-init.php:169
msgid "Cheatin&#8217; huh?"
msgstr ""
@@ -4157,7 +4165,7 @@ msgstr ""
msgid "You must add a shortcode to the content area"
msgstr ""
#: includes/core/class-builtin.php:663 includes/core/class-user.php:1536
#: includes/core/class-builtin.php:663 includes/core/class-user.php:1538
msgid "Only me"
msgstr ""
@@ -6236,116 +6244,116 @@ msgstr ""
msgid "Add translation to %s"
msgstr ""
#: includes/core/class-fields.php:1160
#: includes/core/class-fields.php:1155
msgid "Custom Field"
msgstr ""
#: includes/core/class-fields.php:1457
#: includes/core/class-fields.php:1452
msgid "Please upload a valid image!"
msgstr ""
#: includes/core/class-fields.php:1464 includes/core/class-fields.php:1485
#: includes/core/class-fields.php:1459 includes/core/class-fields.php:1480
msgid "Upload"
msgstr ""
#: includes/core/class-fields.php:1465
#: includes/core/class-fields.php:1460
msgid "Sorry this is not a valid image."
msgstr ""
#: includes/core/class-fields.php:1466
#: includes/core/class-fields.php:1461
msgid "This image is too large!"
msgstr ""
#: includes/core/class-fields.php:1467
#: includes/core/class-fields.php:1462
msgid "This image is too small!"
msgstr ""
#: includes/core/class-fields.php:1468
#: includes/core/class-fields.php:1463
msgid "You can only upload one image"
msgstr ""
#: includes/core/class-fields.php:1935
#: includes/core/class-fields.php:1930
msgid "Current Password"
msgstr ""
#: includes/core/class-fields.php:1964
#: includes/core/class-fields.php:1959
msgid "New Password"
msgstr ""
#: includes/core/class-fields.php:1996
#: includes/core/class-fields.php:1991
#, php-format
msgid "Confirm %s"
msgstr ""
#: includes/core/class-fields.php:2231
#: includes/core/class-fields.php:2226
msgid "Upload Photo"
msgstr ""
#: includes/core/class-fields.php:2252 includes/core/class-fields.php:2276
#: includes/core/class-fields.php:2247 includes/core/class-fields.php:2271
#: includes/core/um-actions-profile.php:724
msgid "Change photo"
msgstr ""
#: includes/core/class-fields.php:2276 includes/core/class-fields.php:2366
#: includes/core/class-fields.php:2271 includes/core/class-fields.php:2368
msgid "Processing..."
msgstr ""
#: includes/core/class-fields.php:2298
#: includes/core/class-fields.php:2293
msgid "Upload File"
msgstr ""
#: includes/core/class-fields.php:2333 includes/core/um-filters-fields.php:230
#: includes/core/class-fields.php:2335 includes/core/um-filters-fields.php:243
msgid "This file has been removed."
msgstr ""
#: includes/core/class-fields.php:2336 includes/core/class-fields.php:2366
#: includes/core/class-fields.php:2338 includes/core/class-fields.php:2368
msgid "Change file"
msgstr ""
#: includes/core/class-fields.php:2366
#: includes/core/class-fields.php:2368
msgid "Save"
msgstr ""
#: includes/core/class-fields.php:3792
#: includes/core/class-fields.php:3791
#, php-format
msgid ""
"Your profile is looking a little empty. Why not <a href=\"%s\">add</a> some "
"information!"
msgstr ""
#: includes/core/class-fields.php:3794
#: includes/core/class-fields.php:3793
msgid "This user has not added any information to their profile yet."
msgstr ""
#: includes/core/class-files.php:241
#: includes/core/class-files.php:256
msgid "Invalid parameters"
msgstr ""
#: includes/core/class-files.php:246
#: includes/core/class-files.php:261
msgid "Invalid coordinates"
msgstr ""
#: includes/core/class-files.php:251
#: includes/core/class-files.php:266
msgid "Invalid file ownership"
msgstr ""
#: includes/core/class-files.php:304
#: includes/core/class-files.php:319
msgid "Invalid nonce"
msgstr ""
#: includes/core/class-files.php:324 includes/core/class-files.php:409
#: includes/core/class-files.php:339 includes/core/class-files.php:424
msgid "A theme or plugin compatibility issue"
msgstr ""
#: includes/core/class-files.php:952
#: includes/core/class-files.php:967
msgid "Ultimate Member: Not a valid temp file"
msgstr ""
#: includes/core/class-files.php:1080
#: includes/core/class-files.php:1095
msgid "Invalid user ID: "
msgstr ""
#: includes/core/class-files.php:1089 includes/core/class-files.php:1117
#: includes/core/class-files.php:1104 includes/core/class-files.php:1132
msgid "Unauthorized to do this attempt."
msgstr ""
@@ -6381,7 +6389,7 @@ msgid "Your password must contain less than 30 characters"
msgstr ""
#: includes/core/class-password.php:536 includes/core/um-actions-account.php:62
#: includes/core/um-actions-form.php:470
#: includes/core/um-actions-form.php:476
msgid ""
"Your password must contain at least one lowercase letter, one capital letter "
"and one number"
@@ -6391,7 +6399,7 @@ msgstr ""
msgid "You must confirm your new password"
msgstr ""
#: includes/core/class-password.php:546 includes/core/um-actions-form.php:479
#: includes/core/class-password.php:546 includes/core/um-actions-form.php:485
msgid "Your passwords do not match"
msgstr ""
@@ -6505,17 +6513,17 @@ msgstr ""
msgid "Wrong nonce"
msgstr ""
#: includes/core/class-shortcodes.php:358
#: includes/core/class-shortcodes.php:355
msgid ""
"This content has been restricted to logged in users only. Please <a href="
"\"{login_referrer}\">login</a> to view this content."
msgstr ""
#: includes/core/class-shortcodes.php:518
#: includes/core/class-shortcodes.php:515
msgid "You are already registered"
msgstr ""
#: includes/core/class-shortcodes.php:759
#: includes/core/class-shortcodes.php:757
msgid "Default Template"
msgstr ""
@@ -6620,136 +6628,136 @@ msgstr ""
msgid "You are not allowed to use this word as your username."
msgstr ""
#: includes/core/um-actions-form.php:276 includes/core/um-actions-form.php:388
#: includes/core/um-actions-form.php:392 includes/core/um-actions-form.php:396
#: includes/core/um-actions-form.php:276 includes/core/um-actions-form.php:394
#: includes/core/um-actions-form.php:398 includes/core/um-actions-form.php:402
#, php-format
msgid "%s is required."
msgstr ""
#: includes/core/um-actions-form.php:401
#: includes/core/um-actions-form.php:407
msgid "Please specify account type."
msgstr ""
#: includes/core/um-actions-form.php:433
#: includes/core/um-actions-form.php:439
msgid "This field is required"
msgstr ""
#: includes/core/um-actions-form.php:435
#: includes/core/um-actions-form.php:441
#, php-format
msgid "%s is required"
msgstr ""
#: includes/core/um-actions-form.php:442
#: includes/core/um-actions-form.php:448
#, php-format
msgid "You are only allowed to enter a maximum of %s words"
msgstr ""
#: includes/core/um-actions-form.php:448
#: includes/core/um-actions-form.php:454
#, php-format
msgid "Your %s must contain at least %s characters"
msgstr ""
#: includes/core/um-actions-form.php:454
#: includes/core/um-actions-form.php:460
#, php-format
msgid "Your %s must contain less than %s characters"
msgstr ""
#: includes/core/um-actions-form.php:463
#: includes/core/um-actions-form.php:469
msgid "You can not use HTML tags here"
msgstr ""
#: includes/core/um-actions-form.php:476
#: includes/core/um-actions-form.php:482
msgid "Please confirm your password"
msgstr ""
#: includes/core/um-actions-form.php:485
#, php-format
msgid "Please select at least %s choices"
msgstr ""
#: includes/core/um-actions-form.php:491
#, php-format
msgid "You can only select up to %s choices"
msgid "Please select at least %s choices"
msgstr ""
#: includes/core/um-actions-form.php:497
#, php-format
msgid "Minimum number limit is %s"
msgid "You can only select up to %s choices"
msgstr ""
#: includes/core/um-actions-form.php:503
#, php-format
msgid "Minimum number limit is %s"
msgstr ""
#: includes/core/um-actions-form.php:509
#, php-format
msgid "Maximum number limit is %s"
msgstr ""
#: includes/core/um-actions-form.php:539
#: includes/core/um-actions-form.php:545
msgid "Please enter numbers only in this field"
msgstr ""
#: includes/core/um-actions-form.php:545
#: includes/core/um-actions-form.php:551
msgid "Please enter a valid phone number"
msgstr ""
#: includes/core/um-actions-form.php:551 includes/core/um-actions-form.php:557
#: includes/core/um-actions-form.php:563 includes/core/um-actions-form.php:569
#: includes/core/um-actions-form.php:575 includes/core/um-actions-form.php:581
#: includes/core/um-actions-form.php:587 includes/core/um-actions-form.php:593
#: includes/core/um-actions-form.php:605
#: includes/core/um-actions-form.php:557 includes/core/um-actions-form.php:563
#: includes/core/um-actions-form.php:569 includes/core/um-actions-form.php:575
#: includes/core/um-actions-form.php:581 includes/core/um-actions-form.php:587
#: includes/core/um-actions-form.php:593 includes/core/um-actions-form.php:599
#: includes/core/um-actions-form.php:611
#, php-format
msgid "Please enter a valid %s username or profile URL"
msgstr ""
#: includes/core/um-actions-form.php:599
#: includes/core/um-actions-form.php:605
msgid "Please enter a valid URL"
msgstr ""
#: includes/core/um-actions-form.php:612 includes/core/um-actions-form.php:626
#: includes/core/um-actions-form.php:618 includes/core/um-actions-form.php:632
msgid "You must provide a username"
msgstr ""
#: includes/core/um-actions-form.php:614 includes/core/um-actions-form.php:628
#: includes/core/um-actions-form.php:620 includes/core/um-actions-form.php:634
msgid "Your username is already taken"
msgstr ""
#: includes/core/um-actions-form.php:616
#: includes/core/um-actions-form.php:622
msgid "Username cannot be an email"
msgstr ""
#: includes/core/um-actions-form.php:618 includes/core/um-actions-form.php:632
#: includes/core/um-actions-form.php:624 includes/core/um-actions-form.php:638
msgid "Your username contains invalid characters"
msgstr ""
#: includes/core/um-actions-form.php:630 includes/core/um-actions-form.php:652
#: includes/core/um-actions-form.php:654 includes/core/um-actions-form.php:666
#: includes/core/um-actions-form.php:673
#: includes/core/um-actions-form.php:636 includes/core/um-actions-form.php:658
#: includes/core/um-actions-form.php:660 includes/core/um-actions-form.php:672
#: includes/core/um-actions-form.php:679
msgid "This email is already linked to an existing account"
msgstr ""
#: includes/core/um-actions-form.php:650
#: includes/core/um-actions-form.php:656
msgid "You must provide your email"
msgstr ""
#: includes/core/um-actions-form.php:656 includes/core/um-actions-form.php:664
#: includes/core/um-actions-form.php:662 includes/core/um-actions-form.php:670
msgid "This is not a valid email"
msgstr ""
#: includes/core/um-actions-form.php:658
#: includes/core/um-actions-form.php:664
msgid "Your email contains invalid characters"
msgstr ""
#: includes/core/um-actions-form.php:698
#: includes/core/um-actions-form.php:704
msgid "You must provide a unique value"
msgstr ""
#: includes/core/um-actions-form.php:708
#: includes/core/um-actions-form.php:714
msgid "You must provide alphabetic letters"
msgstr ""
#: includes/core/um-actions-form.php:718
#: includes/core/um-actions-form.php:724
msgid "You must provide lowercase letters."
msgstr ""
#: includes/core/um-actions-form.php:737
#: includes/core/um-actions-form.php:743
#, php-format
msgid "Your user description must contain less than %s characters"
msgstr ""
@@ -6770,31 +6778,23 @@ msgstr ""
msgid "Please enter your email"
msgstr ""
#: includes/core/um-actions-login.php:52
msgid " Sorry, we can't find an account with that email address"
msgstr ""
#: includes/core/um-actions-login.php:54
msgid " Sorry, we can't find an account with that username"
msgstr ""
#: includes/core/um-actions-login.php:58
#: includes/core/um-actions-login.php:61
msgid "Please enter your password"
msgstr ""
#: includes/core/um-actions-login.php:66
#: includes/core/um-actions-login.php:68
msgid "Password is incorrect. Please try again."
msgstr ""
#: includes/core/um-actions-login.php:194
#: includes/core/um-actions-login.php:199
msgid "This action has been prevented for security measures."
msgstr ""
#: includes/core/um-actions-login.php:418
#: includes/core/um-actions-login.php:423
msgid "Keep me signed in"
msgstr ""
#: includes/core/um-actions-login.php:453
#: includes/core/um-actions-login.php:458
msgid "Forgot your password?"
msgstr ""
@@ -6944,7 +6944,7 @@ msgstr ""
msgid "Last login: %s"
msgstr ""
#: includes/core/um-filters-fields.php:261
#: includes/core/um-filters-fields.php:274
msgid "Untitled photo"
msgstr ""
@@ -6969,11 +6969,11 @@ msgstr ""
msgid "Login as this user"
msgstr ""
#: includes/um-short-functions.php:571
#: includes/um-short-functions.php:580
msgid "date submitted"
msgstr ""
#: includes/um-short-functions.php:577
#: includes/um-short-functions.php:586
msgid "(empty)"
msgstr ""
@@ -7043,37 +7043,37 @@ msgstr ""
msgid "This user has not made any comments."
msgstr ""
#: templates/profile/posts-single.php:16
#: templates/profile/posts-single.php:21
#, php-format
msgid "%s ago"
msgstr ""
#: templates/profile/posts-single.php:17
#: templates/profile/posts-single.php:24
msgid "in"
msgstr ""
#: templates/profile/posts-single.php:18
#: templates/profile/posts-single.php:30
msgid "no comments"
msgstr ""
#: templates/profile/posts-single.php:18
#: templates/profile/posts-single.php:32
#, php-format
msgid "%s comments"
msgstr ""
#: templates/profile/posts-single.php:34
msgid "1 comment"
msgstr ""
#: templates/profile/posts-single.php:18
#, php-format
msgid "% comments"
msgstr ""
#: templates/profile/posts-single.php:27 templates/profile/posts.php:35
#: templates/profile/posts.php:21
msgid "load more posts"
msgstr ""
#: templates/profile/posts.php:43
#: templates/profile/posts.php:32
msgid "You have not created any posts."
msgstr ""
#: templates/profile/posts.php:43
#: templates/profile/posts.php:32
msgid "This user has not created any posts."
msgstr ""
+29 -2
View File
@@ -6,7 +6,7 @@ Donate link:
Tags: community, member, membership, user-profile, user-registration
Requires at least: 4.7
Tested up to: 4.9
Stable tag: 2.0.26
Stable tag: 2.0.29
License: GNU Version 2 or Any Later Version
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -58,6 +58,8 @@ 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 =
@@ -65,6 +67,10 @@ Ultimate Member has a range of extensions that allow you to extend the power of
* [Google reCAPTCHA](https://ultimatemember.com/extensions/google-recaptcha/) - Stop bots on your registration & login forms with Google reCAPTCHA
* [Online Users](https://ultimatemember.com/extensions/online-users/) - Display what users are online with this extension
= Theme =
Our official [theme](https://ultimatemember.com/theme/) is purpose built for websites that have logged in and out users. The [theme](https://ultimatemember.com/theme/) has deep integration with Ultimate Member plugin and the extensions, different header designs for logged-in/out users and works alongside the Beaver Builder and Elementor page builders.
= Development * Translations =
If you're a developer and would like to contribute to the source code of the plugin you can do so via our [GitHub Repository](https://github.com/ultimatemember/ultimatemember).
@@ -131,10 +137,31 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
= Important: UM2.0+ is a significant update to the code base from 1.3.88. Please make sure you take a full-site backup with restore point before updating the plugin =
= 2.0.26: September 18, 2018 =
= 2.0.29: October 8, 2018 =
* Bugfixes:
- Fixed User Profile Posts pagination
= 2.0.28: October 5, 2018 =
* Bugfixes:
- Fixed Email notifications
- Fixed Download files/images for multisites
- Fixed Profile/Cover image for multisites
- Fixed XSS vulnerabilities (detected by @Serhack)
- Fixed trim fields on submit forms
- Fixed submitted info
= 2.0.27: October 2, 2018 =
* Bugfixes:
- Fixed files class
= 2.0.26: October 2, 2018 =
* Enhancements:
- New files/images downloading process
- Added dependencies with User Photos and Groups extensions
* Bugfixes:
- File/Image email placeholders after registration form submitting
+37 -27
View File
@@ -1,30 +1,40 @@
<?php while (UM()->shortcodes()->loop->have_posts()) { UM()->shortcodes()->loop->the_post(); $post_id = get_the_ID(); ?>
<div class="um-item">
<div class="um-item-link">
<i class="um-icon-ios-paper"></i>
<a href="<?php echo get_permalink( $post ) ?>"><?php echo $post->post_title; ?></a>
</div>
<div class="um-item">
<div class="um-item-link"><i class="um-icon-ios-paper"></i><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
<?php if ( has_post_thumbnail( $post_id ) ) {
$image_id = get_post_thumbnail_id( $post_id );
$image_url = wp_get_attachment_image_src( $image_id, 'full', true );
?>
<div class="um-item-img"><a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $post_id, 'medium' ); ?></a></div>
<?php } ?>
<div class="um-item-meta">
<span><?php echo sprintf(__('%s ago','ultimate-member'), human_time_diff( get_the_time('U'), current_time('timestamp') ) ); ?></span>
<span><?php echo __('in','ultimate-member');?>: <?php the_category( ', ' ); ?></span>
<span><?php comments_number( __('no comments','ultimate-member'), __('1 comment','ultimate-member'), __('% comments','ultimate-member') ); ?></span>
</div>
<?php if ( has_post_thumbnail( $post->ID ) ) {
$image_id = get_post_thumbnail_id( $post->ID );
$image_url = wp_get_attachment_image_src( $image_id, 'full', true ); ?>
<div class="um-item-img">
<a href="<?php echo get_permalink( $post ) ?>">
<?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?>
</a>
</div>
<?php } ?>
<?php if ( isset(UM()->shortcodes()->modified_args) && UM()->shortcodes()->loop->have_posts() && UM()->shortcodes()->loop->found_posts >= 10 ) { ?>
<div class="um-load-items">
<a href="#" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-args="<?php echo UM()->shortcodes()->modified_args; ?>"><?php _e('load more posts','ultimate-member'); ?></a>
</div>
<?php } ?>
<div class="um-item-meta">
<span>
<?php printf( __( '%s ago', 'ultimate-member' ), human_time_diff( get_the_time( 'U', $post->ID ), current_time( 'timestamp' ) ) ); ?>
</span>
<span>
<?php echo __( 'in', 'ultimate-member' ); ?>: <?php the_category( ', ', '', $post->ID ); ?>
</span>
<span>
<?php $num_comments = get_comments_number( $post->ID );
if ( $num_comments == 0 ) {
$comments = __( 'no comments', 'ultimate-member' );
} elseif ( $num_comments > 1 ) {
$comments = sprintf( __( '%s comments', 'ultimate-member' ), $num_comments );
} else {
$comments = __( '1 comment', 'ultimate-member' );
} ?>
<a href="<?php echo get_comments_link( $post->ID ) ?>"><?php echo $comments ?></a>
</span>
</div>
</div>
+32 -40
View File
@@ -1,45 +1,37 @@
<?php $query_posts = UM()->query()->make('post_type=post&posts_per_page=10&offset=0&author=' . um_get_requested_user() );
<?php if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
//Only for AJAX loading posts
if ( ! empty( $posts ) ) {
foreach ( $posts as $post ) {
UM()->shortcodes()->set_args = array( 'post' => $post );
UM()->shortcodes()->load_template( 'profile/posts-single' );
}
}
} else {
if ( ! empty( $posts ) ) { ?>
<div class="um-ajax-items">
/**
* UM hook
*
* @type filter
* @title um_profile_query_make_posts
* @description Some changes of WP_Query Posts Tab
* @input_vars
* [{"var":"$query_posts","type":"WP_Query","desc":"UM Posts Tab query"}]
* @change_log
* ["Since: 2.0"]
* @usage
* <?php add_filter( 'um_profile_query_make_posts', 'function_name', 10, 1 ); ?>
* @example
* <?php
* add_filter( 'um_profile_query_make_posts', 'my_profile_query_make_posts', 10, 1 );
* function my_profile_query_make_posts( $query_posts ) {
* // your code here
* return $query_posts;
* }
* ?>
*/
UM()->shortcodes()->loop = apply_filters( 'um_profile_query_make_posts', $query_posts );
<?php foreach ( $posts as $post ) {
UM()->shortcodes()->set_args = array( 'post' => $post );
UM()->shortcodes()->load_template( 'profile/posts-single' );
}
if ( UM()->shortcodes()->loop->have_posts() ) {
if ( $count_posts > 10 ) { ?>
<div class="um-load-items">
<a href="javascript:void(0);" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-author="<?php echo um_get_requested_user(); ?>" data-page="1" data-pages="<?php echo ceil( $count_posts / 10 ) ?>">
<?php _e( 'load more posts', 'ultimate-member' ); ?>
</a>
</div>
<?php } ?>
UM()->shortcodes()->load_template( 'profile/posts-single' ); ?>
<div class="um-ajax-items">
<!--Ajax output-->
<?php if ( UM()->shortcodes()->loop->found_posts >= 10 ) { ?>
<div class="um-load-items">
<a href="#" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-args="post,10,10,<?php echo um_get_requested_user(); ?>"><?php _e('load more posts','ultimate-member'); ?></a>
</div>
</div>
<?php } ?>
</div>
<?php } else { ?>
<?php } else { ?>
<div class="um-profile-note"><span><?php echo ( um_profile_id() == get_current_user_id() ) ? __('You have not created any posts.','ultimate-member') : __('This user has not created any posts.','ultimate-member'); ?></span></div>
<?php } wp_reset_postdata(); ?>
<div class="um-profile-note">
<span>
<?php echo ( um_profile_id() == get_current_user_id() ) ? __( 'You have not created any posts.', 'ultimate-member' ) : __( 'This user has not created any posts.', 'ultimate-member' ); ?>
</span>
</div>
<?php }
}
+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.26
Version: 2.0.29
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member