Edit File by line
/home/barbar84/www/wp-conte.../plugins/wordpres.../src/helpers
File: woocommerce-helper.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Yoast\WP\SEO\Helpers;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Represents helper methods for WooCommerce.
[5] Fix | Delete
*/
[6] Fix | Delete
class Woocommerce_Helper {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Checks if WooCommerce is active.
[10] Fix | Delete
*
[11] Fix | Delete
* @return bool Is WooCommerce active.
[12] Fix | Delete
*/
[13] Fix | Delete
public function is_active() {
[14] Fix | Delete
return \class_exists( 'WooCommerce' );
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Returns the id of the set WooCommerce shop page.
[19] Fix | Delete
*
[20] Fix | Delete
* @return int The ID of the set page.
[21] Fix | Delete
*/
[22] Fix | Delete
public function get_shop_page_id() {
[23] Fix | Delete
if ( ! \function_exists( 'wc_get_page_id' ) ) {
[24] Fix | Delete
return -1;
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
return \wc_get_page_id( 'shop' );
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
/**
[31] Fix | Delete
* Checks if the current page is a WooCommerce shop page.
[32] Fix | Delete
*
[33] Fix | Delete
* @return bool True when the page is a shop page.
[34] Fix | Delete
*/
[35] Fix | Delete
public function is_shop_page() {
[36] Fix | Delete
if ( ! \function_exists( 'is_shop' ) ) {
[37] Fix | Delete
return false;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
if ( ! \is_shop() ) {
[41] Fix | Delete
return false;
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
if ( \is_search() ) {
[45] Fix | Delete
return false;
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
return true;
[49] Fix | Delete
}
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function