Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ankit Singh ankitsingh101

🏠
Working from home
View GitHub Profile
@ankitsingh101
ankitsingh101 / functions.php
Created Apr 28, 2020 — forked from hirejordansmith/functions.php
Add support for ACF custom fields to WooCommerce Attributes
View functions.php
<?php
// Adds a custom rule type.
add_filter( 'acf/location/rule_types', function( $choices ){
$choices[ __("Other",'acf') ]['wc_prod_attr'] = 'WC Product Attribute';
return $choices;
} );
// Adds custom rule values.
add_filter( 'acf/location/rule_values/wc_prod_attr', function( $choices ){
View cb.js
import './editor.scss';
import './style.scss';
const { __ } = wp.i18n; // Import __() from wp.i18n
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
const { InnerBlocks } = wp.blockEditor;
const TEMPLATE = [
['core/heading', { placeholder: 'Recipe Title' }],
@ankitsingh101
ankitsingh101 / 0_reuse_code.js
Created May 8, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.