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
function nativeHorizontalScroll( id ) { | |
var elID = id; | |
var element = document.getElementById( id ); | |
var scrolling = false; | |
var initialX = 0; | |
function getParent( node, id ) { | |
if ( node.id === id ) { | |
return node; | |
} |
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 | |
/** | |
* NOTE: THIS IS NOT TESTED IN PRODUCTION. | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'remove_billing_shipping_wc_fields' ); | |
function remove_billing_shipping_wc_fields( $fields ) { | |
$billing_email = $fields['billing']['billing_email']; |
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
var block = wp.blocks.createBlock('core/paragraph', {content: 'From Console'}); | |
wp.data.dispatch('core/block-editor').insertBlocks(block); |
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( function( $ ) { | |
var cities = wc_city_dropdown.cities; | |
wrapper_selectors = '.woocommerce-billing-fields,' + | |
'.woocommerce-shipping-fields,' + | |
'.woocommerce-address-fields'; | |
$( document.body ).on( 'change refresh', 'select.country_to_state, input.country_to_state', function() { | |
var $wrapper = $( this ).closest( wrapper_selectors ); |
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: Recent Widget Challenge from ibenic.com/newsletter | |
*/ | |
/* | |
You will create a custom WordPress widget that displays a list of the most recent posts. | |
Each recent post should have: |
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 | |
// Trace On so we can easily debug XML we constructed as its returns it. | |
$client = new \SoapClient(SOAP_SERVICE_URL, array('trace' => 1) ); | |
$client->__setSoapHeaders( $header ); |
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 MySettingsFramework; | |
abstract class Settings { | |
/** | |
* Setting ID. Prefixes all options. | |
* @var string | |
*/ |
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: Live API | |
*/ | |
add_action( 'init', function(){ | |
add_shortcode( 'live_api', 'live_api_shortcode' ); | |
}); | |
function live_api_shortcode() { |
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( 'woocommerce_order_status_completed', 'queue_email', 10, 10 ); | |
/** | |
* Generic function that will queue any action as we see fit. | |
*/ | |
function queue_email( ...$args ) { | |
$filter = current_filter(); //woocommerce_order_status_completed | |
$delay = 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
(function($){ | |
$(function(){ | |
$(document.body).on( 'change', '#min_price, #max_price', function(){ | |
var minPrice = parseFloat( $('#min_price').val() ); | |
var maxPrice = parseFloat( $('#max_price').val() ); | |
$('.item-list li').each(function(){ | |
var price = parseFloat( $(this).attr('data-price') ); |
NewerOlder