Create default pages in store locale language
This commit is contained in:
parent
4504c5a8a1
commit
76d7c356c1
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue