Skip to content

Instantly share code, notes, and snippets.

View SketchBookkeeper's full-sized avatar
:octocat:
git status

Paul Allen SketchBookkeeper

:octocat:
git status
View GitHub Profile
@SketchBookkeeper
SketchBookkeeper / stop-video.js
Created March 19, 2019 15:37 — forked from cferdinandi/stop-video.js
A simple method to stop YouTube, Vimeo, and HTML5 videos from playing.
/**
* Stop an iframe or HTML5 <video> from playing
* @param {Element} element The element that contains the video
*/
var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
@SketchBookkeeper
SketchBookkeeper / functions.php
Created February 21, 2019 18:10
Hide Product Category Count in WooCommerce. If you want to hide product category count on the shop page, you only need to add this code to the bottom of your child theme’s functions.php file.
// Hide Product Category Count
add_filter( 'woocommerce_subcategory_count_html', 'prima_hide_subcategory_count' );
function prima_hide_subcategory_count() {
/* empty - no count */
}
@SketchBookkeeper
SketchBookkeeper / .eslintignore
Created February 5, 2019 20:19 — forked from ahmadawais/.eslintignore
WP: Gutenberg ESLint
**/*.min.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@SketchBookkeeper
SketchBookkeeper / custom-menu-items.php
Created November 26, 2018 16:38 — forked from daggerhart/custom-menu-items.php
WordPress class for easily adding custom menu items dynamically to a menu.
<?php
class custom_menu_items {
// only register with wp hooks once
protected $has_registered = false;
// internal list of menus affected
public $menus = array();
// internal list of new menu items
@SketchBookkeeper
SketchBookkeeper / dl-file.php
Created October 24, 2018 15:22 — forked from hakre/dl-file.php
Wordpress login to download uploaded files
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
@SketchBookkeeper
SketchBookkeeper / guten-vue.js
Created September 13, 2018 06:04 — forked from imeczew/guten-vue.js
This is a Gutenberg Block built with Vue.js
( function( wp ) {
var el = wp.element.createElement;
var __ = wp.i18n.__;
wp.blocks.registerBlockType( 'learn-gutenberg/ex2-vue', {
title: __( 'Learn Gutenberg Example 2: VueJS', 'learn-gutenberg' ),
category: 'widgets',
supportHTML: false,
attributes: {
who: {
@SketchBookkeeper
SketchBookkeeper / bling.js
Created March 29, 2018 14:33 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(