Routes::update_route_permalink( int $post_id, WP_Post $new_post, WP_Post $old_post )

Summary

No summary available.

Parameters

$post_id

(int) (Required) Post ID.

$new_post

(WP_Post) (Required) The Post Object

$old_post

(WP_Post) (Required) The Previous Post Object


Source

File: src/BigCommerce/Taxonomies/Channel/Routes.php

	function update_route_permalink( $post_id, $new_post, $old_post ) {

		//check if post slug has changed
		if ( $new_post->post_name == $old_post->post_name ) {
			return;
		}

		$routes_posts   = [];
		$routes_posts[] = get_option( Cart_Page::NAME );
		$routes_posts[] = get_option( Login_Page::NAME );
		$routes_posts[] = get_option( Account_Page::NAME );
		$routes_posts[] = get_option( Shipping_Returns_Page::NAME );
		$routes_posts[] = get_option( Checkout_Complete_Page::NAME );

		if ( in_array( $post_id, $routes_posts ) ) {
			$this->update_routes();
		}
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.