- fixed um_edit_profile_url() function and added $user_id attribute;

- added `disable_restriction_pre_queries` option for backward compatibility with business logic where 404 error isn't good way;
- added `restricted_post_title_replace` option for ability to disable restricted post's title replace
This commit is contained in:
Nikita Sinelnikov
2021-08-25 01:07:09 +03:00
parent 58bbd3cede
commit 9927dab323
6 changed files with 69 additions and 19 deletions
+29 -11
View File
@@ -503,10 +503,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'conditional' => array( 'accessible', '=', 2 ),
),
array(
'id' => 'restricted_access_post_title',
'type' => 'text',
'label' => __( 'Restricted Access Post Title', 'ultimate-member' ),
'tooltip' => __( 'This is the post title shown to users that do not have permission to view the content', 'ultimate-member' ),
'id' => 'restricted_post_title_replace',
'type' => 'checkbox',
'label' => __( 'Replace the restricted Post Title', 'ultimate-member' ),
'tooltip' => __( 'Allow to replace the restricted post title to users that do not have permission to view the content', 'ultimate-member' ),
),
array(
'id' => 'restricted_access_post_title',
'type' => 'text',
'label' => __( 'Restricted Access Post Title', 'ultimate-member' ),
'tooltip' => __( 'This is the post title shown to users that do not have permission to view the content', 'ultimate-member' ),
'conditional' => array( 'restricted_post_title_replace', '=', 1 ),
),
array(
'id' => 'restricted_access_message',
@@ -519,25 +526,28 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$settings_map = array_merge(
$settings_map,
array(
'accessible' => array(
'accessible' => array(
'sanitize' => 'int',
),
'access_redirect' => array(
'access_redirect' => array(
'sanitize' => 'url',
),
'access_exclude_uris' => array(
'access_exclude_uris' => array(
'sanitize' => 'url',
),
'home_page_accessible' => array(
'home_page_accessible' => array(
'sanitize' => 'bool',
),
'category_page_accessible' => array(
'category_page_accessible' => array(
'sanitize' => 'bool',
),
'restricted_access_post_title' => array(
'restricted_post_title_replace' => array(
'sanitize' => 'bool',
),
'restricted_access_post_title' => array(
'sanitize' => 'text',
),
'restricted_access_message' => array(
'restricted_access_message' => array(
'sanitize' => 'wp_kses',
),
)
@@ -1751,6 +1761,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'2.0' => __( '2.0 version', 'ultimate-member' ),
),
),
// backward compatibility option leave it disabled for better security and ability to exclude posts/terms pre-query
// otherwise we filtering only results and restricted posts/terms can be visible
array(
'id' => 'disable_restriction_pre_queries',
'type' => 'checkbox',
'label' => __( 'Disable pre-queries for restriction content logic (advanced)', 'ultimate-member' ),
'tooltip' => __( 'Please enable this option only in the cases when you have big or unnecessary queries on your site with active restriction logic. If you want to exclude posts only from the results queries instead of pre_get_posts and fully-hidden post logic also please enable this option. It activates the restriction content logic until 2.2.x version without latest security enhancements', 'ultimate-member' ),
),
$same_page_update,
array(
'id' => 'uninstall_on_delete',