Merge pull request #884 from ultimatemember/development/2.2.3

Development process 2.2.3
This commit is contained in:
Nikita Sinelnikov
2021-08-23 16:28:00 +03:00
committed by GitHub
13 changed files with 1709 additions and 1577 deletions
+1
View File
@@ -102,6 +102,7 @@ jQuery(document).ready(function() {
user_id = jQuery(this).parents('#um_upload_single').data('user_id');
}
var d;
var form_id = 0;
var mode = '';
if ( jQuery('div.um-field-image[data-key="' + key + '"]').length === 1 ) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -59,8 +59,8 @@ if ( ! class_exists( 'um\admin\core\Admin_DragDrop' ) ) {
}
foreach ( $_POST as $key => $value ) {
$key = sanitize_key( $key );
// don't use sanitize_key here because of a key can be in Uppercase
$key = sanitize_text_field( $key );
// adding rows
if ( 0 === strpos( $key, '_um_row_' ) ) {
+2 -1
View File
@@ -48,7 +48,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
$this->need_upgrade();
$this->check_wrong_licenses();
$this->reviews_notice();
// removed for now to avoid the bad reviews
//$this->reviews_notice();
//$this->future_changed();
File diff suppressed because it is too large Load Diff
+26 -1
View File
@@ -29,6 +29,7 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
add_action( 'um_access_fix_external_post_content', array( &$this, 'bbpress_no_access_message_fix' ), 10 );
add_action( 'um_access_fix_external_post_content', array( &$this, 'forumwp_fix' ), 11 );
add_action( 'um_access_fix_external_post_content', array( &$this, 'woocommerce_fix' ), 12 );
add_filter( 'um_localize_permalink_filter', array( &$this, 'um_localize_permalink_filter' ), 10, 2 );
add_filter( 'icl_ls_languages', array( &$this, 'um_core_page_wpml_permalink' ), 10, 1 );
@@ -151,6 +152,30 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
}
/**
* Fixed Woocommerce access to Products message
*/
function woocommerce_fix() {
if ( UM()->dependencies()->woocommerce_active_check() ) {
add_filter( 'single_template', array( &$this, 'woocommerce_template' ), 9999999, 1 );
}
}
/**
* @param string $single_template
*
* @return string
*/
function woocommerce_template( $single_template ) {
if ( is_product() ) {
remove_filter( 'template_include', array( 'WC_Template_Loader', 'template_loader' ) );
}
return $single_template;
}
/**
* @param $profile_url
* @param $page_id
@@ -558,4 +583,4 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
}
}
}
+19 -4
View File
@@ -709,6 +709,12 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
return '';
}
if ( 'profile' === $this->set_mode ) {
if ( ! isset( UM()->form()->post_form['profile_nonce'] ) || false === wp_verify_nonce( UM()->form()->post_form['profile_nonce'], 'um-profile-nonce' . UM()->user()->target_id ) ) {
return '';
}
}
return stripslashes_deep( UM()->form()->post_form[ $key ] );
} elseif ( um_user( $key ) && $this->editing == true ) {
@@ -2416,10 +2422,10 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
} elseif( isset( $data['label'] ) ) {
$placeholder = sprintf( __( 'Confirm %s', 'ultimate-member' ), $data['label'] );
}
$output .= '<input class="' . $this->get_class( $key, $data ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . UM()->form()->form_suffix ) . '" value="' . $this->field_value( $key, $default, $data ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />';
$output .= '</div>';
@@ -2591,7 +2597,8 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$output .= ob_get_clean();
$output .= '<br /><span class="description">' . $placeholder . '</span>';
} else {
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $height ) . ';" class="' . $this->get_class( $key, $data ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '">' . esc_textarea( strip_tags( $field_value ) ) . '</textarea>';
$textarea_field_value = ! empty( $data['html'] ) ? $field_value : strip_tags( $field_value );
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $height ) . ';" class="' . $this->get_class( $key, $data ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '">' . esc_textarea( $textarea_field_value ) . '</textarea>';
}
$output .= '</div>';
@@ -2621,7 +2628,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$output .= '<div class="um-rating um-raty" id="' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-number="' . esc_attr( $data['number'] ) . '" data-score="' . $this->field_value( $key, $default, $data ) . '"></div>';
$output .= '</div>';
if ( $this->is_error( $key ) ) {
$output .= $this->field_error( $this->show_error( $key ) );
} elseif ( $this->is_notice( $key ) ) {
@@ -3878,6 +3885,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
UM()->form()->form_suffix = '-' . $this->global_args['form_id'];
$this->set_mode = $mode;
if ( 'profile' === $mode ) {
UM()->form()->nonce = wp_create_nonce( 'um-profile-nonce' . UM()->user()->target_id );
}
$this->set_id = $this->global_args['form_id'];
$this->field_icons = ( isset( $this->global_args['icons'] ) ) ? $this->global_args['icons'] : 'label';
@@ -4122,6 +4134,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
if ( ! empty( $res ) ) {
$res = stripslashes( $res );
}
if ( 'description' === $data['metakey'] ) {
$res = nl2br( $res );
}
$data['is_view_field'] = true;
/**
+11 -4
View File
@@ -32,6 +32,9 @@ if ( ! class_exists( 'um\core\Form' ) ) {
var $post_form = null;
var $nonce = null;
/**
* Form constructor.
*/
@@ -331,14 +334,18 @@ if ( ! class_exists( 'um\core\Form' ) ) {
if ( $http_post && ! is_admin() && isset( $_POST['form_id'] ) && is_numeric( $_POST['form_id'] ) ) {
$this->form_id = absint( $_POST['form_id'] );
$this->form_status = get_post_status( $this->form_id );
$this->form_data = UM()->query()->post_data( $this->form_id );
$this->form_id = absint( $_POST['form_id'] );
if ( 'um_form' !== get_post_type( $this->form_id ) ) {
return;
}
$this->form_status = get_post_status( $this->form_id );
if ( 'publish' !== $this->form_status ) {
return;
}
$this->form_data = UM()->query()->post_data( $this->form_id );
/**
* UM hook
*
@@ -579,7 +586,7 @@ if ( ! class_exists( 'um\core\Form' ) ) {
$form[ $k ] = (int) $form[ $k ];
break;
case 'textarea':
if ( ! empty( $field['html'] ) ) {
if ( ! empty( $field['html'] ) || ( UM()->profile()->get_show_bio_key( $form ) === $k && UM()->options()->get( 'profile_show_html_bio' ) ) ) {
$form[ $k ] = wp_kses_post( $form[ $k ] );
} else {
$form[ $k ] = sanitize_textarea_field( $form[ $k ] );
+12 -10
View File
@@ -29,11 +29,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
*/
function add_posts() {
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => 0,
'author' => um_get_requested_user(),
'post_status' => array( 'publish' )
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => 0,
'author' => um_get_requested_user(),
'post_status' => array( 'publish' ),
'um_main_query' => true,
);
/**
@@ -107,11 +108,12 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
$page = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 0;
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => ( $page - 1 ) * 10,
'author' => $author,
'post_status' => array( 'publish' )
'post_type' => 'post',
'posts_per_page' => 10,
'offset' => ( $page - 1 ) * 10,
'author' => $author,
'post_status' => array( 'publish' ),
'um_main_query' => true,
);
/**
+1 -1
View File
@@ -629,7 +629,7 @@ function um_editing_user_id_input( $args ) {
if ( UM()->fields()->editing == 1 && UM()->fields()->set_mode == 'profile' && UM()->user()->target_id ) { ?>
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( UM()->user()->target_id ); ?>" />
<input type="hidden" name="profile_nonce" id="profile_nonce" value="<?php echo esc_attr( wp_create_nonce( 'um-profile-nonce' . UM()->user()->target_id ) ); ?>" />
<input type="hidden" name="profile_nonce" id="profile_nonce" value="<?php echo esc_attr( UM()->form()->nonce ); ?>" />
<?php }
}
+18 -2
View File
@@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration
Requires PHP: 5.6
Requires at least: 5.0
Tested up to: 5.8
Stable tag: 2.2.2
Stable tag: 2.2.3
License: GNU Version 2 or Any Later Version
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -155,11 +155,27 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
* To learn more about version 2.1 please see this [docs](https://docs.ultimatemember.com/article/1512-upgrade-2-1-0)
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
= 2.2.3: August 4, 2021 =
= 2.2.3: August 25, 2021 =
* Enhancements:
- Added: 'um_ignore_restricted_title' hook for workaround show post title of the restricted post
* Bugfixes:
- Fixed: `pre_get_terms` callback to avoid the conflicts with other terms queries
- Fixed: Terms query and global access settings on PHP8 installations
- Fixed: Member directory dropdown filters where options contain `&` symbol
- Fixed: Displaying 404 error for the restricted Media
- Fixed: Displaying 'Login as this user' action on the user profile
- Fixed: Sanitizing of the social links fields (e.g. Twitter, Facebook, etc.)
- Fixed: Visibility of a restricted taxonomy page in the nav menu
- Fixed: Sanitizing key for the drag&drop action
- Fixed: Sanitizing the description field with allowed HTML inside
- Fixed: The "Assignment to constant variable" JS error on some sites
- Fixed: Keep description formatting in a view mode
- Fixed: Profile form nonce handling, security enhancement
- Optimized: Restriction content handlers, avoid queries duplicates or unnecessary queries
= 2.2.2: August 3, 2021 =
+2 -2
View File
@@ -3,7 +3,7 @@
<div class="um-item">
<div class="um-item-link">
<i class="um-icon-ios-paper"></i>
<a href="<?php echo esc_url( get_permalink( $post ) ); ?>"><?php echo esc_html( $post->post_title ); ?></a>
<a href="<?php echo esc_url( get_permalink( $post ) ); ?>"><?php echo get_the_title( $post ); ?></a>
</div>
<?php if ( has_post_thumbnail( $post->ID ) ) {
@@ -39,4 +39,4 @@
<a href="<?php echo esc_url( get_comments_link( $post->ID ) ); ?>"><?php echo $comments; ?></a>
</span>
</div>
</div>
</div>
+1 -1
View File
@@ -3,7 +3,7 @@
Plugin Name: Ultimate Member
Plugin URI: http://ultimatemember.com/
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
Version: 2.2.3-beta
Version: 2.2.3
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member