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
/** | |
* @snippet Enable Payment Gateway for a Specific User Role | WooCommerce | |
*/ | |
function custom_paypal_enable_manager( $available_gateways ) { | |
global $woocommerce; | |
if ( isset( $available_gateways['paypal'] ) && !current_user_can('shop_manager') ) { | |
unset( $available_gateways['paypal'] ); | |
} | |
return $available_gateways; |
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
<div class="page-width" data-section-id="{{ section.id }}" data-section-type="cart-template"> | |
{% if cart.item_count > 0 %} | |
<div class="section-header text-center"> | |
<h1>{{ 'cart.general.title' | t }}</h1> | |
</div> | |
<form action="/cart" method="post" novalidate class="cart"> | |
{% if customer.tags contains 'wholesaler' %} | |
{% for custag in customer.tags %} |
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
<div class="discountcodefield"> | |
<label for="discount">Discount Code:</label> | |
<input autocomplete="off" type="hidden" name="discount" class="discount_code" /> | |
<input autocomplete="off" type="text" name="discount_code" class="discount_code_field" /> | |
<input type="button" name="apply_discount_code" class="btn discount_code_btn" value="Apply"/> | |
</div> | |
<div class="cart__savings discount_apply_code"> | |
</div> |
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
$(document).on("click", '.mylink', function(event) { | |
alert("new link clicked!"); | |
}); |
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
<video src="video.ogv" id="myVideo"> | |
video not supported | |
</video> | |
<script type='text/javascript'> | |
document.getElementById('myVideo').addEventListener('ended',myHandler,false); | |
function myHandler(e) { | |
// What you want to do after the event | |
} | |
</script> |
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
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
NewerOlder