| @@ -48,5 +48,24 @@ | ||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return true; |
| 51 | 51 | } |
| 52 | + | |
| 53 | + /** | |
| 54 | + * Checks if the current page is a WooCommerce shop page. | |
| 55 | + * | |
| 56 | + * @return bool True when the page is a shop page. | |
| 57 | + */ | |
| 58 | + public function current_post_is_terms_and_conditions_page() { | |
| 59 | + if ( ! \function_exists( 'wc_terms_and_conditions_page_id' ) ) { | |
| 60 | + return false; | |
| 61 | + } | |
| 62 | + | |
| 63 | + global $post; | |
| 64 | + | |
| 65 | + if ( ! isset( $post->ID ) ) { | |
| 66 | + return false; | |
| 67 | + } | |
| 68 | + | |
| 69 | + return (int) $post->ID === (int) \wc_terms_and_conditions_page_id(); | |
| 70 | + } | |
| 52 | 71 | } |