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
[ | |
{ | |
"action": { | |
"type": "block" | |
}, | |
"trigger": { | |
"url-filter": ".*", | |
"resource-type": ["script"], | |
"load-type": ["third-party"], | |
"if-domain": ["*imore.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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 shopp('collection.description'); ?> | |
<?php if ( shopp( 'collection.hasproducts' ) ) : ?> | |
<div class="category"> | |
<?php shopp( 'storefront.breadcrumb', array( 'separator' => ' » ' ) ); ?> | |
<ul class="products"> | |
<?php while( shopp( 'collection.products' ) ) : ?> | |
<li class="product<?php if ( shopp('collection.row') ) echo ' first'; ?>" itemscope itemtype="http://schema.org/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
function the_slug() { | |
$post_data = get_post($post->ID, ARRAY_A); | |
$slug = $post_data['post_name']; | |
return $slug; } |
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 | |
/* Pull apart OEmbed video link to get thumbnails out*/ | |
function get_video_thumbnail_uri( $video_uri ) { | |
$thumbnail_uri = ''; | |
// determine the type of video and the video id | |
$video = parse_video_uri( $video_uri ); | |
// get youtube thumbnail |
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 | |
wc_dropdown_variation_attribute_options( array( | |
'options' => $options, | |
//'attribute' => $attribute_name, | |
'product' => $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
/** | |
* NOTE: code from http://scottnelle.com/756/async-defer-enqueued-wordpress-scripts/ | |
* Add async attributes to enqueued scripts where needed. | |
* The ability to filter script tags was added in WordPress 4.1 for this purpose. | |
*/ | |
function my_async_scripts( $tag, $handle, $src ) { | |
// the handles of the enqueued scripts we want to async | |
$async_scripts = array( 'some-script', 'another-script' ); | |
if ( in_array( $handle, $async_scripts ) ) { |
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
<div | |
class="wp-block-group__inner-container block-editor-block-list__layout" | |
data-is-drop-zone="true" | |
> | |
<div | |
class="block-editor-block-list__block wp-block" | |
id="block-8daf5358-8d64-4cc4-a89c-66e0f00ffe4d" | |
tabindex="0" | |
role="group" | |
aria-label="Block: Practice Area Card" |
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
//validation for name field in GF to prevent nonsense spam names. Rejects any string with 4 consecutive consonants. | |
add_filter( 'gform_field_validation', 'validate_name', 10, 4 ); | |
function validate_name( $result, $value, $form, $field ) { | |
if ( 'name' === $field->type && $field->isRequired ) { | |
GFCommon::log_debug( __METHOD__ . '(): Name values => ' . print_r( $value, true ) ); | |
$pattern = "/(?=[a-z]{4})[^aeiou]{4}/"; |
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
$terms = get_the_terms( $post->ID, 'product_cat' ); | |
foreach ($terms as $term ) { | |
$product_cat_id = $term->term_id; | |
$product_cat_name = $term->name; | |
} | |
return ['post_type'=>'product','tax_query' => array( | |
array( | |
'taxonomy' => 'product_cat', | |
'field' => 'slug', |
OlderNewer