WC_Admin_Post_Types::hide_cpt_archive_templates()
When editing the shop page, we should hide templates.
Метод класса: WC_Admin_Post_Types{}
Хуков нет.
Возвращает
Массив
.
Использование
$WC_Admin_Post_Types = new WC_Admin_Post_Types(); $WC_Admin_Post_Types->hide_cpt_archive_templates( $page_templates, $theme, $post );
- $page_templates(массив) (обязательный)
- Templates array.
- $theme(строка) (обязательный)
- Classname.
- $post(WP_Post) (обязательный)
- The current post object.
Код WC_Admin_Post_Types::hide_cpt_archive_templates() WC Admin Post Types::hide cpt archive templates WC 9.7.1
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; }