|
Server : LiteSpeed System : Linux srv104790275 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : dewac4139 ( 1077) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /home/sarkas88.com/public_html/wp-content/plugins/wordpress-seo/src/helpers/ |
Upload File : |
<?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() );
}
}