Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit d973534

Browse files
committed
Revert "Fix: sync_endpoint_with_page should use a matching slug if it exists instead of creating a new page (#10640)"
This reverts commit c68583b.
1 parent e37a3ec commit d973534

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/BlockTemplatesController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -855,15 +855,6 @@ public function update_template_permalink( $value, $option ) {
855855
* @return string THe actual permalink assigned to the page. May differ from $permalink if it was already taken.
856856
*/
857857
protected function sync_endpoint_with_page( $page, $page_slug, $permalink ) {
858-
$matching_page = get_page_by_path( $permalink );
859-
860-
if ( $matching_page && 'publish' === $matching_page->post_status ) {
861-
// Existing page matches given permalink; use its ID.
862-
update_option( 'woocommerce_' . $page_slug . '_page_id', $matching_page->ID );
863-
return $permalink;
864-
}
865-
866-
// No matching page; either update current page (by ID stored in option table) or create a new page.
867858
if ( ! $page ) {
868859
$updated_page_id = wc_create_page(
869860
esc_sql( $permalink ),

0 commit comments

Comments
 (0)