File Editor
Directories:
.. (Back)
open-graph
schema
twitter
Files:
aioseo-helper.php
asset-helper.php
attachment-cleanup-helper.php
author-archive-helper.php
blocks-helper.php
capability-helper.php
crawl-cleanup-helper.php
curl-helper.php
current-page-helper.php
date-helper.php
environment-helper.php
first-time-configuration-notice-helper.php
home-url-helper.php
image-helper.php
import-cursor-helper.php
import-helper.php
indexable-helper.php
indexable-to-postmeta-helper.php
indexing-helper.php
language-helper.php
meta-helper.php
notification-helper.php
options-helper.php
pagination-helper.php
permalink-helper.php
post-helper.php
post-type-helper.php
primary-term-helper.php
product-helper.php
redirect-helper.php
require-file-helper.php
robots-helper.php
robots-txt-helper.php
sanitization-helper.php
score-icon-helper.php
short-link-helper.php
site-helper.php
social-profiles-helper.php
string-helper.php
taxonomy-helper.php
url-helper.php
user-helper.php
wincher-helper.php
woocommerce-helper.php
wordpress-helper.php
wpdb-helper.php
Create New File
Create
Edit File: woocommerce-helper.php
<?php namespace Yoast\WP\SEO\Helpers; /** * Represents helper methods for WooCommerce. */ class Woocommerce_Helper { /** * Checks if WooCommerce is active. * * @return bool Is WooCommerce active. */ public function is_active() { return \class_exists( 'WooCommerce' ); } /** * Returns the id of the set WooCommerce shop page. * * @return int The ID of the set page. */ public function get_shop_page_id() { if ( ! \function_exists( 'wc_get_page_id' ) ) { return -1; } return \wc_get_page_id( 'shop' ); } /** * Checks if the current page is a WooCommerce shop page. * * @return bool True when the page is a shop page. */ public function is_shop_page() { if ( ! \function_exists( 'is_shop' ) ) { return false; } if ( ! \is_shop() ) { return false; } if ( \is_search() ) { return false; } return true; } /** * Checks if the current page is a WooCommerce shop page. * * @return bool True when the page is a shop page. */ public function current_post_is_terms_and_conditions_page() { if ( ! \function_exists( 'wc_terms_and_conditions_page_id' ) ) { return false; } global $post; if ( ! isset( $post->ID ) ) { return false; } return \intval( $post->ID ) === \intval( \wc_terms_and_conditions_page_id() ); } }
Save Changes
Rename File
Rename