This file contains hidden or 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 | |
| /** | |
| * Elementor get polylang translation of template | |
| */ | |
| add_filter( 'elementor/theme/get_location_templates/template_id', function( $post_id ) { | |
| if(!is_admin()){ | |
| if ( function_exists( 'pll_get_post' ) ) { |
This file contains hidden or 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 | |
| /** | |
| * Fix for Elementor template conditions not compatible with Polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme) | |
| * Needs to be priority 1, since Polylang uses the action parse_query which is fired before pre_get_posts | |
| * | |
| * @link https://github.com/polylang/polylang/issues/152#issuecomment-320602328 | |
| * | |
| * @param WP_Query $query | |
| */ | |
| function polylang_elementor_library_conditions_parse_query( $query ) { |
This file contains hidden or 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 | |
| /** | |
| * Product Open Pricing plugin: Customize Product Title with Price | |
| * | |
| * @param WC_Cart $cart | |
| */ | |
| function custom_woocommerce_before_calculate_totals( $cart ) { | |
| if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
| return; |
This file contains hidden or 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. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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){ | |