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
-
(array) (Required) Templates array.
- $theme
-
(string) (Required) Classname.
- $post
-
(WP_Post) (Required) The current post object.
Return Return
(array)
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; }