diff --git a/changelog/deprecate-ptranslation-load-functions b/changelog/deprecate-ptranslation-load-functions new file mode 100644 index 0000000000..d737f3d66e --- /dev/null +++ b/changelog/deprecate-ptranslation-load-functions @@ -0,0 +1,4 @@ +Significance: patch +Type: deprecated + +Deprecate `load_localisation` and `load_plugin_textdomain` functions diff --git a/changelog/remove-loading-translations-code b/changelog/remove-loading-translations-code new file mode 100644 index 0000000000..3445d012e2 --- /dev/null +++ b/changelog/remove-loading-translations-code @@ -0,0 +1,4 @@ +Significance: patch +Type: removed + +Removed manual loading of translations diff --git a/includes/class-sensei.php b/includes/class-sensei.php index 955079274c..0813df9c27 100644 --- a/includes/class-sensei.php +++ b/includes/class-sensei.php @@ -511,10 +511,7 @@ private function __construct( $main_plugin_file_name, $args ) { * @since 1.9.0 */ protected function init() { - - // Localisation. - $this->load_plugin_textdomain(); - add_action( 'init', array( $this, 'load_localisation' ), 0 ); + // Localization. add_action( 'update_option_WPLANG', array( $this, 'maybe_initiate_rewrite_rules_flush_after_language_change' ), 10, 2 ); add_action( 'upgrader_process_complete', array( $this, 'maybe_initiate_rewrite_rules_flush_on_translation_update' ), 10, 2 ); @@ -986,9 +983,10 @@ public function register_widgets() { * * @access public * @since 1.0.0 - * @return void + * @deprecated $$next-version$$ */ public function load_localisation() { + _deprecated_function( __METHOD__, '$$next-version$$' ); load_plugin_textdomain( 'sensei-lms', false, dirname( plugin_basename( $this->main_plugin_file_name ) ) . '/lang/' ); } @@ -998,9 +996,11 @@ public function load_localisation() { * * @access public * @since 1.0.0 - * @return void + * @deprecated $$next-version$$ */ public function load_plugin_textdomain() { + _deprecated_function( __METHOD__, '$$next-version$$' ); + $domain = 'sensei-lms'; if ( is_admin() ) { diff --git a/tests/e2e-playwright/pages/admin/courses/courses.ts b/tests/e2e-playwright/pages/admin/courses/courses.ts index 78d2fdc6c2..88e3ee42ba 100644 --- a/tests/e2e-playwright/pages/admin/courses/courses.ts +++ b/tests/e2e-playwright/pages/admin/courses/courses.ts @@ -44,7 +44,7 @@ export default class CoursesPage extends PostType { this.wizardModal = new WizardModal( wizardLocator ); this.createCourseButton = page.locator( - 'a.page-title-action[href$="post-new.php?post_type=course"]:has-text("New Course")' + 'a.page-title-action[href$="post-new.php?post_type=course"]:has-text("New Course"):visible' ); this.publishButton = page.locator( diff --git a/tests/e2e-playwright/pages/admin/courses/index.ts b/tests/e2e-playwright/pages/admin/courses/index.ts index 3dc42b10eb..bf0221ef03 100644 --- a/tests/e2e-playwright/pages/admin/courses/index.ts +++ b/tests/e2e-playwright/pages/admin/courses/index.ts @@ -92,7 +92,7 @@ export default class CoursesPage extends PostType { this.wizardModal = new WizardModal( wizardLocator ); this.createCourseButton = page.locator( - 'a.page-title-action[href$="post-new.php?post_type=course"]:has-text("New Course")' + 'a.page-title-action[href$="post-new.php?post_type=course"]:has-text("New Course"):visible' ); this.courseOutlineBlock = new CourseOutline( page );