mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- 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:
@@ -416,8 +416,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
array(
|
||||
'id' => '_um_access_hide_from_queries',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'description' => __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'value' => 1,
|
||||
'conditional' => array( '_um_accessible', '!=', '0' ),
|
||||
),
|
||||
@@ -568,8 +568,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
array(
|
||||
'id' => '_um_access_hide_from_queries',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'description' => __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '',
|
||||
'conditional' => array( '_um_accessible', '!=', '0' ),
|
||||
),
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user