set_pages_to_draft()

Summary

No summary available.

Source

File: uninstall.php

function set_pages_to_draft() {
	$pages = [
		Pages\Account_Page::NAME,
		Pages\Address_Page::NAME,
		Pages\Cart_Page::NAME,
		Pages\Check_Balance_Page::NAME,
		Pages\Gift_Certificate_Page::NAME,
		Pages\Login_Page::NAME,
		Pages\Orders_Page::NAME,
		Pages\Registration_Page::NAME,
		Pages\Shipping_Returns_Page::NAME,
	];
	foreach ( $pages as $option ) {
		$page_id = \get_option( $option );
		if ( $page_id ) {
			$post              = \get_post( $page_id );
			$post->post_status = 'draft';
			\wp_update_post( $post );
		}
		\delete_option( $option );
	}
}


User Contributed Notes

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