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 | |
/** | |
* Sort order for ACF Field: acf_production_tour_periods_excluded_dates | |
*/ | |
add_filter('acf/load_value/name=acf_production_tour_periods_excluded_dates', 'acf_production_tour_periods_excluded_dates_load_value', 10, 3); | |
function acf_production_tour_periods_excluded_dates_load_value( $value, $post_id, $field ) { | |
// vars | |
$order = array(); |
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 | |
/** | |
* Category Subtitle | |
* | |
*/ | |
function be_category_subtitle() { | |
// Make sure this is a category archive | |
if( ! is_category() ) |
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 be_call_to_action() { | |
$title = esc_html( get_option( 'options_be_cta_title' ) ); | |
$button_text = esc_html( get_option( 'options_be_cta_button_text' ) ); | |
$button_url = esc_url( get_option( 'options_be_cta_button_url' ) ); | |
if( $title && $button_text && $button_url ) | |
echo '<div class="call-to-action"><div class="wrap"><p>' . $title . '</p><p><a href="' . $button_url . '" class="button">' . $button_text . '</a></p></div></div>'; |
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 | |
/** | |
* Your Child Theme | |
* | |
* Template Name: Landing | |
*/ | |
/** | |
* Flexible Content | |
* |
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 | |
$videos = get_post_meta( get_the_ID(), 'be_attorney_video', true ); | |
if( $videos ) { | |
for( $i = 0; $i < $videos; $i++ ) { | |
$title = esc_html( get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_title', true ) ); | |
$video = esc_url( get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_video', true ) ); | |
$thumbnail = (int) get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_thumbnail', true ); | |
// Thumbnail field returns image ID, so grab image. If none provided, use default image |
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_filter( 'woocommerce_single_product_image_thumbnail_html', 'yanco_woocommerce_single_product_image_thumbnail_html', 10, 2 ); | |
function yanco_woocommerce_single_product_image_thumbnail_html( $html, $post_thumbnail_id ) { | |
$product_id = get_the_ID(); | |
$product_id_to_get_data_from = $product_id; | |
if( get_field( 'acf_get_data_from_product_enabled', $product_id ) === true ) { | |
$product_id_to_get_data_from = get_field( 'acf_get_data_from_product', $product_id ); |
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 | |
/** | |
* Autocomplete subscription 'parent' and 'renewal' orders | |
*/ | |
add_filter( 'woocommerce_payment_complete_order_status', 'yanco_wcs_return_completed', 10, 3); | |
/** | |
* Return "completed" as an order status. | |
* |
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 | |
/** | |
* Autocomplete 'simple' orders | |
*/ | |
add_action( 'woocommerce_thankyou', 'yanco_woocommerce_auto_complete_order' ); | |
/** | |
* Updates the status of a correctly processed order to 'Complete' | |
* |
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_filter( 'woocommerce_order_item_needs_processing' , 'yanco_woocommerce_order_item_needs_processing', 10, 3 ); | |
function yanco_woocommerce_order_item_needs_processing( $needs_processing, $product, $order_ID ) { | |
$product_type = $product->get_type(); | |
if ( $product->is_virtual() | |
&& ( 'subscription' == $product_type || 'subscription_variation' == $product_type || 'variable-subscription' == $product_type ) ) { | |
return false; | |
} |
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 | |
/** | |
* Modify WooCommerce Product filter widget | |
*/ | |
add_filter( 'woocommerce_product_categories_widget_args', 'yanco_woocommerce_product_categories_widget_args', 10, 1 ); | |
function yanco_woocommerce_product_categories_widget_args( $list_args ) { | |
$include_ids = array(); |