Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
CustomizeStore::has_custom_template()
Checks if the post is a template or a template part.
Method of the class: CustomizeStore{}
No Hooks.
Return
true|false
. Whether the post is a template or a template part.
Usage
// private - for code of main (parent) class only $result = $this->has_custom_template( $post );
- $post(WP_Post) (required)
- The post object.
CustomizeStore::has_custom_template() CustomizeStore::has custom template code WC 9.7.1
private function has_custom_template( WP_Post $post ) { return in_array( $post->post_type, array( 'wp_template', 'wp_template_part' ), true ); }