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 | |
/** | |
* Display track and trace if available | |
*/ | |
add_filter( 'woocommerce_admin_order_preview_get_order_details', 'yanco_woocommerce_admin_order_preview_track_and_trace', 8, 2 ); | |
function yanco_woocommerce_admin_order_preview_track_and_trace( $args, $order ) { | |
$order_id = $order->get_id(); | |
$carrier = get_post_meta( $order_id, 'carrier', true ); |
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_action('cancelled_subscription', 'remove_course_access', 10, 2); | |
add_action('subscription_put_on-hold', 'remove_course_access', 10, 2); | |
add_action('subscription_expired', 'remove_course_access', 10, 2); | |
add_action('activated_subscription', 'give_course_access', 10, 2); | |
function send_receipt($order_id){ | |
//if($new_status == 'processing' && $status != 'completed' || $new_status == 'completed' && $status == 'processing'){ | |
if($status != 'processing' && $status != 'completed') { |
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_action( 'pre_get_posts', 'set_posts_per_page' ); | |
function set_posts_per_page( $query ) { | |
if( !is_admin() ) { | |
if( is_search() ) { | |
$tax_query = (array) $query->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_visibility', |
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_action( 'pre_get_posts', 'set_posts_per_page' ); | |
function set_posts_per_page( $query ) { | |
if( !is_admin() ) { | |
if( is_search() ) { | |
$tax_query = (array) $query->get( 'tax_query' ); | |
$tax_query[] = array( | |
'taxonomy' => 'product_visibility', |
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 | |
/** | |
* Disables repeat purchase for the product | |
* | |
* @param bool $purchasable true if product can be purchased | |
* @param \WC_Product $product the WooCommerce product | |
* @return bool $purchasable the updated is_purchasable check | |
*/ | |
function sv_disable_repeat_purchase( $purchasable, $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 | |
/** | |
* Process Shortcodes in Gravity Forms field labels | |
*/ | |
define( 'ACF_GRAVITY_FORM_ID', 1 ); // The ID of the form to process | |
add_filter( 'gform_pre_render_' . ACF_GRAVITY_FORM_ID, 'yanco_process_shortcodes_gravityforms_field_labels' ); | |
function yanco_process_shortcodes_gravityforms_field_labels( $form ) { |
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
DELETE FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT ID from wp_posts WHERE post_title = 'sfn_followup_emails' | |
); | |
DELETE FROM wp_posts WHERE post_title = 'sfn_followup_emails'; | |
DELETE FROM wp_postmeta | |
WHERE post_id IN ( | |
SELECT ID from wp_posts WHERE post_title = 'wcs_report_update_cache' and post_status != 'pending' |
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 | |
/** | |
* @wordpress-plugin | |
* Plugin Name: Search by Algolia for WooCommerce - Instant & Relevant results | |
*/ | |
/** | |
* If Algolia is not active, let users know. |
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 | |
// define( 'ONE_MB', 1024 ); // 1 * 1024 | |
// define( 'TWENTYFIVE_MB', 26214400 ); // 25 * 1024 | |
// define( 'TWENTYFOUR_MB', 25165824 ); // 24 * 1025 | |
define( 'LARGE_NOTIFICATIONS_ATTACHMENT_LIMIT_IN_BYTES', 25165824 ); // 24 * 1025 = 24MB | |
add_filter( 'gform_notification', 'yanco_filter_large_notification_attachments', 10, 3 ); | |
function yanco_filter_large_notification_attachments( $notification, $form, $entry ) { |
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 | |
/** | |
* This file contains a bunch of helper functions that handle add caching to core WordPress functions. | |
*/ | |
/** | |
* Cached version of get_category_by_slug. | |
* | |
* @param string $slug Category slug | |
* @return object|null|bool Term Row from database. Will return null if $slug doesn't match a term. If taxonomy does not exist then false will be returned. |