Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mharis's full-sized avatar

Haris Zulfiqar mharis

View GitHub Profile
@mharis
mharis / hooks.php
Last active November 16, 2018 12:41
<?php
/**
* Adds Gutenberg Blocks with ACF.
*
* @return void
*/
function wds_register_acf_gutenberg_blocks() {
if ( function_exists( 'acf_register_block' ) ) {
// Register the hero block.
acf_register_block(array(
const { __, setLocaleData } = wp.i18n;
const { registerBlockType } = wp.blocks;
const blockStyle = {
backgroundColor: '#900',
color: '#fff',
padding: '20px',
};
setLocaleData( window.gutenberg_examples_01_esnext.localeData, 'gutenberg-examples' );
/**
* Hello World: Step 1
*
* Simple block, renders and saves the same content without interactivity.
*
* Using inline styles - no external stylesheet needed. Not recommended
* because all of these styles will appear in `post_content`.
*/
( function( blocks, i18n, element ) {
var el = element.createElement;
// Require our dependencies
const autoprefixer = require( 'autoprefixer' );
const babel = require( 'gulp-babel' );
const bourbon = require( 'bourbon' ).includePaths;
const browserSync = require( 'browser-sync' );
const cheerio = require( 'gulp-cheerio' );
const concat = require( 'gulp-concat' );
const cssnano = require( 'gulp-cssnano' );
const del = require( 'del' );
const eslint = require( 'gulp-eslint' );
{
"name": "wd_s",
"version": "1.0.0",
"description": "A theme boilerplate for WebDevStudios.",
"main": "Gulpfile.js",
"dependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"bourbon": "^4.3.4",
"bourbon-neat": "^1.9.0",
/*
Theme Name: Storefront Child Theme
Theme URI:
Template: storefront
Author: WebDevStudios
Author URI: https://webdevstudios.com
Description: A storefront child theme.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@mharis
mharis / submenu.js
Created October 19, 2018 19:32
Accessible submenus
/**
* File submenu-toggle.js
*
* Allow submenus to be toggled by keyboard.
*/
window.subMenuToggler = {};
( function( window, $, app ) {
// Constructor.
app.init = function() {
<label class="toggle-button">
<span class="screen-reader-text"><?php esc_html_e( 'Toggle between Yearly and Monthly Pricing.', 'maintainn' ); ?></span>
<input id="monthly-yearly-toggle" type="checkbox" checked />
<label>
<div class="toggle-button-switch"></div>
</label>
</label> <!-- .toggle-button -->
git diff --name-status --color prod HEAD > changelog.txt
<?php
require_once dirname( __FILE__ ) . '/makepot.php';
if ( !defined( 'STDERR' ) ) {
define( 'STDERR', fopen( 'php://stderr', 'w' ) );
}
/**
* Extend to add text domain check