This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Gateway Icon for "Payment On Site" | |
* | |
* | |
* @param string $icon The icon html markup | |
* | |
* @return string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce: hide shipping when products marked as "local pickup only" are in the cart | |
* Tested with WordPress 5.3.4 and WooCommerce 4.2.0 | |
* | |
* The shipping class "local-pickup-only" needs to be created first. | |
* Then assign the products that are have "local pickup only" to this class | |
* | |
* @param array $rates | |
* @param array $package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Yoast Schema: Remove datePublished on WebPage | |
* | |
* @param array $schema | |
* | |
* @return mixed | |
*/ | |
function custom_wpseo_schema_webpage( $schema ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add LocalBusiness to schema Organization | |
* | |
* @api array $data The graph piece to filter. | |
* | |
* @return array | |
*/ | |
function custom_wpseo_schema_organization($data){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce: Adds Brand attribute to "Product" Structured Data | |
* | |
* @param array $data | |
* | |
* @return array | |
*/ | |
function woocommerce_structured_data_product_brand ($data) { | |
global $product; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function woocommerce_remove_my_memberships_table() { | |
if ( function_exists( 'wc_memberships' ) | |
&& method_exists( wc_memberships(), 'get_frontend_instance' ) | |
&& method_exists( wc_memberships()->get_frontend_instance(), 'get_members_area_instance' ) | |
) { | |
remove_filter( 'woocommerce_account_menu_items', | |
array( wc_memberships()->get_frontend_instance()->get_members_area_instance(), 'add_account_members_area_menu_item' ), 999 ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket) | |
* | |
* @since 1.0.9 | |
*/ | |
function woocommerce_scheduled_sales_empty_wprocket_cache(){ | |
// Clear WP Rocket Cache (whole site) | |
if ( function_exists( 'rocket_clean_domain' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t1.ID, t1.user_email, | |
MAX(CASE WHEN t2.meta_key = 'first_name' THEN meta_value END) AS first_name, | |
MAX(CASE WHEN t2.meta_key = 'last_name' THEN meta_value END) AS last_name, | |
MAX(CASE WHEN t2.meta_key = 'paying_customer' THEN meta_value END) AS paying_customer, | |
MAX(CASE WHEN t2.meta_key = 'billing_title' THEN meta_value END) AS billing_title | |
FROM th_users AS t1 | |
INNER JOIN th_usermeta AS t2 ON t1.ID = t2.user_id | |
GROUP BY t1.ID, t1.user_email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT meta_key, COUNT(*) FROM wp_postmeta GROUP BY meta_key ORDER BY COUNT(*) DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filters the recipient of the data request confirmation notification. | |
* | |
* In a Multisite environment, this will default to the email address of the | |
* network admin because, by default, single site admins do not have the | |
* capabilities required to process requests. Some networks may wish to | |
* delegate those capabilities to a single-site admin, or a dedicated person | |
* responsible for managing privacy requests. |