Skip to content

Commit

Permalink
WordPress 6.7 compatibility changes for translation - CHANGED
Browse files Browse the repository at this point in the history
  • Loading branch information
kprajapatii committed Nov 22, 2024
1 parent c744b39 commit 18ea86d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/class-userswp.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ private function init_hooks() {
add_action( 'admin_init', array( 'UsersWP_Activator', 'automatic_upgrade' ) );
add_action( 'init', array( 'UsersWP_Activator', 'init_background_updater' ), 5 );
add_action( 'widgets_init', array( $this, 'register_widgets' ) );
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) );
add_action( 'uwp_flush_rewrite_rules', array( $this, 'flush_rewrite_rules' ) );
add_action( 'uwp_language_file_add_string', array( $this, 'register_string' ), 10, 1 );
add_action( 'after_setup_theme', array( $this, 'hide_admin_bar' ));
Expand Down Expand Up @@ -905,7 +905,7 @@ public function load_plugin_textdomain() {
*/
$locale = apply_filters( 'plugin_locale', $locale, 'userswp' );

unload_textdomain( 'userswp' );
unload_textdomain( 'userswp', true );
load_textdomain( 'userswp', WP_LANG_DIR . '/userswp/userswp-' . $locale . '.mo' );
load_plugin_textdomain( 'userswp', false, plugin_basename( dirname( USERSWP_PLUGIN_FILE ) ) . '/languages/' );

Expand Down
10 changes: 10 additions & 0 deletions includes/class-uwp-privacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ public function __construct() {
include_once 'class-uwp-privacy-exporters.php';
include_once 'class-uwp-privacy-erasers.php';

// Initialize data exporters and erasers.
add_action( 'init', array( $this, 'register_erasers_exporters' ) );
}

/**
* Initial registration of privacy erasers and exporters.
*
* Due to the use of translation functions, this should run only after plugins loaded.
*/
public function register_erasers_exporters() {
// This hook registers userswp data exporters.
$this->add_exporter( 'uwp-customer-data', __( 'UsersWP User Data', 'userswp' ), array( 'UsersWP_Privacy_Exporters', 'user_data_exporter' ) );

Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ Yes, you can customize it with Elementor, but also with Gutenberg, Divi, Beaver

== Changelog ==

= 1.2.22 - TBD =
* WordPress 6.7 compatibility changes for translation - CHANGED

= 1.2.21 - 2024-11-12 =
* Update AUI & SD - CHANGED

Expand Down

0 comments on commit 18ea86d

Please sign in to comment.