Automattic\WooCommerce\Internal\Admin

Loader::delete_homepage()public staticWC 1.0

Delete woocommerce_onboarding_homepage_post_id field when the homepage is deleted

Method of the class: Loader{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = Loader::delete_homepage( $post_id );
$post_id(int) (required)
The deleted post id.

Loader::delete_homepage() code WC 8.9.0

public static function delete_homepage( $post_id ) {
	if ( 'page' !== get_post_type( $post_id ) ) {
		return;
	}
	$homepage_id = intval( get_option( 'woocommerce_onboarding_homepage_post_id', false ) );
	if ( $homepage_id === $post_id ) {
		delete_option( 'woocommerce_onboarding_homepage_post_id' );
	}
}