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('wc_avatax_order_origin_address', 'verde_change_avatax_order_origin_address', 10, 2 ); | |
// add_filter('wc_avatax_order_destination_address', 'verde_change_avatax_order_origin_address', 10, 2 ); | |
function verde_change_avatax_order_origin_address( $origin_address, $order ){ | |
$origin_address = array(); // empty saved address | |
$branch_id = get_post_meta($order->id, '_avatax_branch_id', true); | |
$branch_address = get_post_meta( $branch_id, 'wpsl_address', true ); | |
$branch_city = get_post_meta( $branch_id, 'wpsl_city', 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 | |
function sort_posts( $posts, $orderby, $order = 'ASC', $unique = true ) { | |
if ( ! is_array( $posts ) ) { | |
return false; | |
} | |
usort( $posts, array( new Sort_Posts( $orderby, $order ), 'sort' ) ); | |
// use post ids as the array keys | |
if ( $unique && count( $posts ) ) { |
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 | |
/* | |
* Template Name: Custom List Page | |
*/ | |
get_header(); | |
$post_id = get_the_ID(); | |
$meta_list = Sort_The_List::get_postmeta_from_db( $post_id ); | |
if ( empty( $meta_list ) ) { | |
return; | |
} |
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 | |
class Sort_The_List { | |
static public function get_postmeta_from_db( int $post_id ){ | |
$full_meta = []; | |
$the_meta = get_post_meta( $post_id, '_your_meta_key', true ); | |
foreach( $the_meta as $key => $value ){ | |
if( is_array( $value ) || is_object( $value ) ) { | |
foreach( $value as $k => $v ) { |
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 | |
namespace Tribe\Project\Theme; | |
use Tribe\Libs\Post_Type\Post_Object; | |
use Tribe\Project\Cordoba_Api\Metaboxes; | |
use Tribe\Project\Post_Meta\Instrument_Meta; | |
use Tribe\Project\Post_Types\Guitar\Guitar; | |
use Tribe\Project\Post_Types\Ukulele\Ukulele; | |
use Tribe\Project\Taxonomies\Family\Family; | |
use Tribe\Project\Taxonomies\Has_Electronics\Has_Electronics; |
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 | |
# from Divi shop module Shop.php | |
# $toggle_filter( 'woocommerce_shortcode_products_query', array( $this, 'shortcode_products_query_cb' ), 10 ); | |
# from WC class-wc-shortcode-products.php | |
# $query_args = apply_filters( 'woocommerce_shortcode_products_query', $query_args, $this->attributes, $this->type ); | |
# $query_args['meta_query'] = WC()->query->get_meta_query(); | |
add_filter( 'woocommerce_shortcode_products_query', 'remove_if_no_thumbnail', 20, 3); | |
function remove_if_no_thumbnail( $query_args, $attributes, $type ){ |
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 | |
/* From https://www.usps.com/send/official-abbreviations.htm */ | |
$us_state_abbrevs_names = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AS'=>'AMERICAN SAMOA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', |
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 | |
/* Plugin Name: WooCommerce Orders Table Rows Not Clickable | |
* Plugin URI: https://rayflores.com | |
* Description: Orders table rows are no longer clickable on <td> element | |
* Version: 1.0 | |
* Author: Ray Flores | |
* Author URI: https://rayflores.com | |
*/ | |
/** |
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
jQuery(document).ready(function() | |
// when the builder isn’t active… | |
if ( typeof FLBuilder == 'undefined' && typeof FLBuilderLayout != 'undefined' ) { | |
// grab main node and replace here, then grab inner header div and replace here | |
jQuery('.fl-node-5a4543bc2c784').insertAfter('.hero-inner'); | |
} | |
//And here if you need it to run when the builder is active… | |
if ( typeof FLBuilder != 'undefined' ) { | |
// Your JS here. | |
} |
NewerOlder