- changed labels;

- fixed get_archives query based on restricted posts;
This commit is contained in:
Nikita Sinelnikov
2021-07-29 17:20:16 +03:00
parent 2e964ab408
commit f5278a462f
5 changed files with 31 additions and 10 deletions
+6 -6
View File
@@ -65,7 +65,7 @@ var um_block_restriction = wp.compose.createHigherOrderComponent( function( Bloc
wp.element.createElement(
wp.components.PanelBody,
{
title: wp.i18n.__( 'UM access Controls', 'ultimate-member' ),
title: wp.i18n.__( 'Ultimate Member: Content Restriction', 'ultimate-member' ),
className: 'um_block_settings'
},
wp.element.createElement(
@@ -93,7 +93,7 @@ var um_block_restriction = wp.compose.createHigherOrderComponent( function( Bloc
{
type: 'number',
className: um_condition_fields['um_who_access'],
label: wp.i18n.__( 'Who can access this content?', 'ultimate-member' ),
label: wp.i18n.__( 'Who can access this block?', 'ultimate-member' ),
value: props.attributes.um_who_access,
options: [
{
@@ -132,7 +132,7 @@ var um_block_restriction = wp.compose.createHigherOrderComponent( function( Bloc
{
multiple: true,
className: um_condition_fields['um_roles_access'],
label: wp.i18n.__( 'What roles can access this content?', 'ultimate-member' ),
label: wp.i18n.__( 'What roles can access this block?', 'ultimate-member' ),
value: props.attributes.um_roles_access,
options: um_restrict_roles,
onChange: function onChange( value ) {
@@ -145,7 +145,7 @@ var um_block_restriction = wp.compose.createHigherOrderComponent( function( Bloc
{
type: 'number',
className: um_condition_fields['um_message_type'],
label: wp.i18n.__( 'Restriction Action', 'ultimate-member' ),
label: wp.i18n.__( 'Restriction action', 'ultimate-member' ),
value: props.attributes.um_message_type,
options: [
{
@@ -176,7 +176,7 @@ var um_block_restriction = wp.compose.createHigherOrderComponent( function( Bloc
{
type: 'number',
className: um_condition_fields['um_message_content'],
label: wp.i18n.__( 'Restriction Message Content', 'ultimate-member' ),
label: wp.i18n.__( 'Custom restricted access message', 'ultimate-member' ),
value: props.attributes.um_message_content,
onChange: function onChange( value ) {
props.setAttributes({ um_message_content: value });
@@ -232,4 +232,4 @@ function um_add_block_attributes( settings ) {
return settings;
}
wp.hooks.addFilter( 'blocks.registerBlockType', 'um-block/um_add_block_attributes', um_add_block_attributes );
wp.hooks.addFilter( 'blocks.registerBlockType', 'um-block/um_add_block_attributes', um_add_block_attributes );
+2 -2
View File
@@ -551,12 +551,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
array(
'id' => 'restricted_blocks',
'type' => 'checkbox',
'label' => __( 'Allow Gutenberg Blocks restriction options', 'ultimate-member' ),
'label' => __( 'Enable the "Content Restriction" settings for the Gutenberg Blocks', 'ultimate-member' ),
),
array(
'id' => 'restricted_block_message',
'type' => 'textarea',
'label' => __( 'Restricted Block Message', 'ultimate-member' ),
'label' => __( 'Restricted Access Block Message', 'ultimate-member' ),
'tooltip' => __( 'This is the message shown to users that do not have permission to view the block\'s content', 'ultimate-member' ),
'conditional' => array( 'restricted_blocks', '=', 1 ),
),
+20
View File
@@ -62,6 +62,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
add_filter( 'widget_posts_args', array( &$this, 'exclude_restricted_posts_widget' ), 99, 1 );
add_filter( 'wp_count_posts', array( &$this, 'custom_count_posts_handler' ), 99, 3 );
add_filter( 'getarchives_where', array( &$this, 'exclude_restricted_posts_archives_widget' ), 99, 2 );
// callbacks for changing terms query
add_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99, 1 );
@@ -1444,6 +1445,25 @@ if ( ! class_exists( 'um\core\Access' ) ) {
}
/**
* Exclude restricted posts in widgets
*
* @param string $sql_where
* @param array $parsed_args
*
* @return string
*/
function exclude_restricted_posts_archives_widget( $sql_where, $parsed_args ) {
$exclude_posts = $this->exclude_posts_array();
if ( ! empty( $exclude_posts ) ) {
$exclude_string = implode( ',', $exclude_posts );
$sql_where .= ' AND ID NOT IN ( ' . $exclude_string . ' )';
}
return $sql_where;
}
/**
* @param string $single_template
*
+2 -1
View File
@@ -155,12 +155,13 @@ 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.1: July 26, 2021 =
= 2.2.1: August 2, 2021 =
* Bugfixes:
- Fixed: Sanitizing `max-width` value of the Login/Registration/Profile form settings
- Fixed: Sanitizing `in_group` field's data
- Fixed: Restriction settings related with `Hide in queries`
- Fixed: Restriction settings and performance issues on some installations
= 2.2.0: July 20, 2021 =
+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.1-beta
Version: 2.2.1-rc.1
Author: Ultimate Member
Author URI: http://ultimatemember.com/
Text Domain: ultimate-member