Skip to content

Instantly share code, notes, and snippets.

View andreiglingeanu's full-sized avatar

Andrei Glingeanu andreiglingeanu

View GitHub Profile
<?php
add_filter(
'blocksy:general:blocks:query:args',
function ($query_args, $attributes) {
if (
isset($attributes['uniqueId'])
&&
$attributes['uniqueId'] === '9afc2324'
) {
<?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)) {
<?php
add_action(
'init',
function () {
global $wpdb;
$wpdb->query(
"
DELETE
<?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);
}
}
<?php
add_filter(
'rest_post_search_query',
function ($args) {
$args['post_type'] = array_diff(
$args['post_type'],
['ct_content_block']
);
<?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;
}
<?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;
}
<?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,
<!-- wp:greenshift-blocks/container {"id":"gsbp-0d5da125-696c","flexbox":{"type":"flexbox","flexDirection":["row"],"alignItems":["center"]}} -->
<div class="wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-0d5da125-696c" id="gspb_container-id-gsbp-0d5da125-696c"><!-- wp:greenshift-blocks/container {"id":"gsbp-75215e2d-0f25"} -->
<div class="wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-75215e2d-0f25" id="gspb_container-id-gsbp-75215e2d-0f25"><!-- wp:greenshift-blocks/container {"id":"gsbp-e8691acf-5cf5"} -->
<div class="wp-block-greenshift-blocks-container gspb_container gspb_container-gsbp-e8691acf-5cf5" id="gspb_container-id-gsbp-e8691acf-5cf5"><!-- wp:greenshift-blocks/swiper {"id":"gsbp-2572c851-1139","tabs":6,"slidesPerView":[2.2,null,null,null],"speed":8000,"loop":true,"autoplay":true,"autoplayRestore":true,"autodelay":0,"navigationarrows":false,"bullets":false,"overflow":true,"freemode":true,"linearmode":true,"freemodeSticky":true} -->
<div class="wp-blo
<?php
add_action('wp_head', function () {
$term_id = get_queried_object_id();
if (! is_woocommerce() || ! $term_id || is_product()) {
return;
}
$attachment_id = get_term_meta($term_id, 'thumbnail_id');