* changed hook for initialization of email templates paths;

* removed `load_plugin_textdomain` due to (article)[https://make.wordpress.org/core/2024/10/21/i18n-improvements-6-7/#Enhanced-support-for-only-using-PHP-translation-files]
* deprecated `UM()->localize()` function;
* deprecated `um_language_textdomain` filter hook;
This commit is contained in:
Mykyta Synelnikov
2024-11-29 14:09:23 +02:00
parent f5d81f1a41
commit b892a70756
4 changed files with 47 additions and 64 deletions
+8 -8
View File
@@ -55,12 +55,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
// change the title of the post
add_filter( 'the_title', array( &$this, 'filter_restricted_post_title' ), 10, 2 );
// change the content of the restricted post
add_filter( 'the_content', array( &$this, 'filter_restricted_post_content' ), 999999, 1 );
add_filter( 'the_content', array( &$this, 'filter_restricted_post_content' ), 999999 );
// change the excerpt of the restricted post
add_filter( 'get_the_excerpt', array( &$this, 'filter_restricted_post_excerpt' ), 999999, 2 );
// comments queries
add_action( 'pre_get_comments', array( &$this, 'exclude_posts_comments' ), 99, 1 );
add_action( 'pre_get_comments', array( &$this, 'exclude_posts_comments' ), 99 );
add_filter( 'wp_count_comments', array( &$this, 'custom_comments_count_handler' ), 99, 2 );
// comments RSS
add_filter( 'comment_feed_where', array( &$this, 'exclude_posts_comments_feed' ), 99, 2 );
@@ -97,19 +97,19 @@ if ( ! class_exists( 'um\core\Access' ) ) {
add_filter( 'has_post_thumbnail', array( &$this, 'filter_post_thumbnail' ), 99, 3 );
// Change recent posts widget query.
add_filter( 'widget_posts_args', array( &$this, 'exclude_restricted_posts_widget' ), 99, 1 );
add_filter( 'widget_posts_args', array( &$this, 'exclude_restricted_posts_widget' ), 99 );
// Exclude pages displayed by wp_list_pages function.
add_filter( 'wp_list_pages_excludes', array( &$this, 'exclude_restricted_pages' ), 10, 1 );
add_filter( 'wp_list_pages_excludes', array( &$this, 'exclude_restricted_pages' ) );
// Archives list change where based on restricted posts.
add_filter( 'getarchives_where', array( &$this, 'exclude_restricted_posts_archives_widget' ), 99, 2 );
// Callbacks for changing posts query.
add_action( 'pre_get_posts', array( &$this, 'exclude_posts' ), 99, 1 );
add_action( 'pre_get_posts', array( &$this, 'exclude_posts' ), 99 );
add_filter( 'posts_where', array( &$this, 'exclude_posts_where' ), 10, 2 );
add_filter( 'wp_count_posts', array( &$this, 'custom_count_posts_handler' ), 99, 3 );
// Callbacks for changing terms query.
add_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99, 1 );
add_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99 );
// there is posts (Posts/Page/CPT) filtration if site is accessible
// there also will be redirects if they need
@@ -124,12 +124,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
remove_action( 'pre_get_terms', array( &$this, 'exclude_hidden_terms_query' ), 99 );
remove_filter( 'widget_posts_args', array( &$this, 'exclude_restricted_posts_widget' ), 99 );
remove_filter( 'wp_list_pages_excludes', array( &$this, 'exclude_restricted_pages' ), 10 );
remove_filter( 'wp_list_pages_excludes', array( &$this, 'exclude_restricted_pages' ) );
remove_filter( 'getarchives_where', array( &$this, 'exclude_restricted_posts_archives_widget' ), 99 );
remove_filter( 'get_next_post_where', array( &$this, 'exclude_navigation_posts' ), 99 );
remove_filter( 'get_previous_post_where', array( &$this, 'exclude_navigation_posts' ), 99 );
remove_action( 'pre_get_posts', array( &$this, 'exclude_posts' ), 99 );
remove_filter( 'posts_where', array( &$this, 'exclude_posts_where' ), 10 );
remove_filter( 'posts_where', array( &$this, 'exclude_posts_where' ) );
remove_filter( 'wp_count_posts', array( &$this, 'custom_count_posts_handler' ), 99 );
}