Fix pages were being re-created even though not set during a db migration closes #30532

This commit is contained in:
roykho 2021-08-19 09:53:57 -07:00
parent c975dda18c
commit 5a725b9ff5
No known key found for this signature in database
GPG Key ID: 7B36C0EA25795714
1 changed files with 10 additions and 0 deletions

View File

@ -2273,7 +2273,17 @@ function wc_update_500_db_version() {
* See @link https://github.com/woocommerce/woocommerce/issues/29235.
*/
function wc_update_560_create_refund_returns_page() {
function filter_created_pages( $pages ) {
$page_to_create = array( 'refund_returns' );
return array_intersect_key( $pages, array_flip( $page_to_create ) );
}
add_filter( 'woocommerce_create_pages', 'filter_created_pages' );
WC_Install::create_pages();
remove_filter( 'woocommerce_create_pages', 'filter_created_pages' );
}
/**