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 | |
| /** | |
| * Custom Failed Payment Retry Rules for WooCommerce Subscriptions | |
| * @param $default_retry_rules_array | |
| * @return array | |
| */ | |
| function wc_subscription_custom_retry_rules($default_retry_rules_array ){ | |
| return array( | |
| array( |
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 Parent ID to the Renewal orders of the Subscriptions | |
| * Compatible with High-Performance Order Storage (HPOS) | |
| * | |
| * @param WC_Subscription $subscription | |
| * @param WC_Order $order | |
| */ | |
| function add_parent_order_id_to_renewal_orders( $subscription, $order ) { |
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 | |
| /** | |
| * Extend WooCommerce admin order search with custom meta fields. | |
| * | |
| * Usage: | |
| * - Add your custom meta keys in the $custom_fields array. | |
| * - Works for searching order meta in admin order list. | |
| */ | |
| add_filter( 'woocommerce_shop_order_search_fields', function( $search_fields ) { |
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 | |
| /** | |
| * Change Coupon to Promo code | |
| * @param $translated_text | |
| * @param $text | |
| * @param $text_domain | |
| * @return mixed | |
| */ | |
| function woocommerce_rename_coupon_field_on_cart($translated_text, $text, $text_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 | |
| /** | |
| * Hide shipping rates when free shipping is available. | |
| * Updated to support WooCommerce 2.6 Shipping Zones. | |
| * | |
| * @param array $rates Array of rates found for the package. | |
| * @return array | |
| */ | |
| function hide_shipping_when_free_is_available( $rates ) { | |
| $free = array(); |
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 | |
| /** | |
| * Allow SVG | |
| */ | |
| add_filter('wp_check_filetype_and_ext', function ($data, $file, $filename, $mimes) { | |
| global $wp_version; | |
| if ($wp_version !== '4.7.1') { | |
| return $data; | |
| } |
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 | |
| /** | |
| * Authenticate Rest API in WordPress | |
| **/ | |
| add_filter( 'rest_authentication_errors', function( $result ) { | |
| // If a previous authentication check was applied, | |
| // pass that result along without modification. | |
| if ( true === $result || is_wp_error( $result ) ) { |
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 | |
| // Disable automatic redirect for posts | |
| add_filter('Yoast\WP\SEO\post_redirect_slug_change', '__return_true' ); | |
| // Disable automatic redirect for taxonomies | |
| add_filter('Yoast\WP\SEO\term_redirect_slug_change', '__return_true' ); | |
| // Disable automatic redirect notifications for Posts or Pages moved to Trash or changed url | |
| add_filter('Yoast\WP\SEO\enable_notification_post_trash', '__return_false' ); |
NewerOlder