This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Astra_Enqueue_Scripts::has_woocommerce_shortcode( string $content )
Check if content has WooCommerce shortcodes.
Description
Parameters
- $content
-
(string) (Required) Post content to check.
Return
(bool)
Source
File: inc/core/class-astra-enqueue-scripts.php
private static function has_woocommerce_shortcode( $content ) {
// Check for common WooCommerce shortcodes.
$shortcodes = array(
'products',
'product_page',
'product_category',
'recent_products',
'sale_products',
'best_selling_products',
'top_rated_products',
'featured_products',
'product_attribute',
);
foreach ( $shortcodes as $shortcode ) {
if ( has_shortcode( $content, $shortcode ) ) {
return true;
}
}
return false;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.11.18 | Introduced. |