Create default pages in store locale language

This commit is contained in:
Shojib khan 2023-04-18 23:49:28 +06:00
parent 4504c5a8a1
commit 76d7c356c1
1 changed files with 6 additions and 0 deletions

View File

@ -710,6 +710,9 @@ class WC_Install {
* Create pages that the plugin relies on, storing page IDs in variables. * Create pages that the plugin relies on, storing page IDs in variables.
*/ */
public static function create_pages() { public static function create_pages() {
// Set the locale to the store locale to ensure pages are created in the correct language.
wc_switch_to_site_locale();
include_once dirname( __FILE__ ) . '/admin/wc-admin-functions.php'; include_once dirname( __FILE__ ) . '/admin/wc-admin-functions.php';
/** /**
@ -780,6 +783,9 @@ class WC_Install {
! empty( $page['post_status'] ) ? $page['post_status'] : 'publish' ! empty( $page['post_status'] ) ? $page['post_status'] : 'publish'
); );
} }
// Restore the locale to the default locale.
wc_restore_locale();
} }
/** /**