WC_Admin_Post_Types::hide_cpt_archive_templates( array $page_templates, string $theme, WP_Post $post )

When editing the shop page, we should hide templates.


Description Description


Parameters Parameters

$page_templates

(Required) Templates array.

$theme

(Required) Classname.

$post

(Required) The current post object.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/admin/class-wc-admin-post-types.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

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