Skip to content

Instantly share code, notes, and snippets.

View andreiglingeanu's full-sized avatar

Andrei Glingeanu andreiglingeanu

View GitHub Profile
<!-- 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');
<?php
add_filter(
'blocksy:pro:post-types-extra:acf:collect-fields',
function ($fields, $all_fields) {
$fields_to_allow = ['image'];
$result = [];
foreach ($all_fields as $single_field) {
<?php
add_filter('blocksy:woocommerce:product-single:layout', function ($layout) {
// Inspect layout for more info
foreach ($layout as $key => $value) {
if ($value['id'] === 'product_title') {
$layout[$key]['enabled'] = false;
}
}
# WARNING: Run all the commands one by one and carefully examine the output of each command
# 1. First run the replace with dry run, to see which tables exactly will be affected and how many replacements will be there.
wp search-replace --dry-run "paletteColor" "theme-palette-color-"
wp search-replace --dry-run "buttonInitialColor" "theme-button-background-initial-color"
wp search-replace --dry-run "var(--fontFamily)" "var(--theme-font-family)"
wp search-replace --dry-run "var(--color)" "var(--theme-text-color)"
# 2. Actually perform the replacement
<?php
add_action(
'blocksy:woocommerce:product-single:price:after',
function () {
if (function_exists('woocommerce_gzd_template_loop_price_unit')) {
woocommerce_gzd_template_loop_price_unit();
}
}
);
<?php
namespace Blocksy;
class Plugin {
/**
* Blocksy instance.
*
* Holds the blocksy plugin instance.
*
import { dispatch, select } from '@wordpress/data'
import swipercss from '!!raw-loader!../../../../libs/swiper/swiper-bundle.min.css'
import { applyFilters } from '@wordpress/hooks'
export default function gspb_Css_Final(id, final_css = '', props = {}) {
let inlineloading = false
if (greenShift_params.isSaveInline) {
inlineloading = true
<?php
namespace Blocksy\CustomPostType\Integrations;
class GreenShift extends \Blocksy\CustomPostTypeRenderer {
public function get_content($args = []) {
return \Blocksy\CustomPostTypeRenderer::NOT_IMPLEMENTED;
/*
$content_post = get_post($this->id);
<?php
namespace Blocksy;
/*
*/
class Capabilities {
private $accounts_cache = null;