WC_Admin_Post_Types::hide_cpt_archive_templates()publicWC 1.0

When editing the shop page, we should hide templates.

{} It's a method of the class: WC_Admin_Post_Types{}

No Hooks.

Return

Array.

Usage

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->hide_cpt_archive_templates( $page_templates, $theme, $post );
$page_templates(array) (required)
Templates array.
$theme(string) (required)
Classname.
$post(WP_Post) (required)
The current post object.

Code of WC_Admin_Post_Types::hide_cpt_archive_templates() WC 6.7.0

public function hide_cpt_archive_templates( $page_templates, $theme, $post ) {
	$shop_page_id = wc_get_page_id( 'shop' );

	if ( $post && absint( $post->ID ) === $shop_page_id ) {
		$page_templates = array();
	}

	return $page_templates;
}