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


(array) (Required) Templates array.


(string) (Required) Classname.


(WP_Post) (Required) The current post object.

Top ↑

Return Return


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.