- fixed #1005;
- fixed #1006;
- fixed #1010;
This commit is contained in:
Nikita Sinelnikov
2022-06-09 17:17:15 +03:00
parent ffadc8e99d
commit 72d58f709d
4 changed files with 122 additions and 4 deletions
+6 -3
View File
@@ -49,9 +49,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
// NEW HOOKS
// callbacks for changing terms query
add_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99, 1 );
// Change recent posts widget query
add_filter( 'widget_posts_args', array( &$this, 'exclude_restricted_posts_widget' ), 99, 1 );
// Exclude pages displayed by wp_list_pages function
@@ -114,6 +111,9 @@ if ( ! class_exists( 'um\core\Access' ) ) {
* Rollback function for old business logic to avoid security enhancements with 404 errors
*/
function disable_restriction_pre_queries() {
// callbacks for changing terms query
add_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99, 1 );
if ( ! UM()->options()->get( 'disable_restriction_pre_queries' ) ) {
return;
}
@@ -728,6 +728,9 @@ if ( ! class_exists( 'um\core\Access' ) ) {
} elseif ( '1' == $restriction['_um_restrict_by_custom_message'] ) {
$content = ! empty( $restriction['_um_restrict_custom_message'] ) ? stripslashes( $restriction['_um_restrict_custom_message'] ) : '';
}
// translators: %s: Restricted post message.
$content = sprintf( __( '%s', 'ultimate-member' ), $content );
}
return $content;