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( | |
'blocksy:woocommerce:product-card:thumbnail:ratio', | |
function ($ratio) { | |
// Please change this | |
$my_page_id = 123; | |
if (is_page($my_page_id)) { | |
// Your custom ratio |
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( | |
'blocksy:general:blocks:query:args', | |
function ($query_args, $attributes) { | |
if ( | |
isset($attributes['uniqueId']) | |
&& | |
$attributes['uniqueId'] === '9afc2324' | |
) { |
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( | |
'blocksy:pro:content-blocks:condition-match', | |
function ($matches, $content_block_id) { | |
if ($content_block_id === 15054) { | |
$resume_id = get_queried_object_id(); | |
if (! resume_manager_user_can_view_resume($resume_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 | |
add_action( | |
'init', | |
function () { | |
global $wpdb; | |
$wpdb->query( | |
" | |
DELETE |
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 | |
if (! function_exists('write_log')) { | |
function write_log($log) { | |
if (is_array($log) || is_object($log)) { | |
error_log(print_r($log, true)); | |
} else { | |
error_log($log); | |
} | |
} |
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( | |
'blocksy:pro:custom-post-type:output-content', | |
function ($content, $id) { | |
$BLOCKSY_THANK_YOU_PAGE_ID = 2478; | |
if ($id !== $BLOCKSY_THANK_YOU_PAGE_ID) { | |
return $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 | |
add_filter( | |
'rest_post_search_query', | |
function ($args) { | |
$args['post_type'] = array_diff( | |
$args['post_type'], | |
['ct_content_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
// Nullify the transforms of the element | |
// | |
// This is all behaving just like getBoundingClientRect() but it nullifies all the transforms | |
// and kinds _reverts_ the element onto its original position. | |
// This will work even with complex translations, rotations. | |
// The beauty is in the way it applies matrix inverse onto the transformation | |
// matrix and mutates the getboundingclientrect along the way. | |
// | |
// Usage: | |
// let { top, left } = nullifyTransforms(el); |
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( | |
'blocksy:pro:woocommerce-extra:swatches:has-single-product-swatches', | |
function ($has_single_product_swatches) { | |
global $product; | |
if (has_term(array('sneakers'), 'product_cat', $product->get_id())) { | |
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 | |
add_filter( | |
'blocksy:pro:woocommerce-extra:swatches:has-single-product-swatches', | |
function ($has_single_product_swatches) { | |
global $product; | |
$products_without_swatches = [ | |
// list all product IDs that should not have swatches | |
105, |
NewerOlder