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
add_action( 'woocommerce_order_status_completed', 'callback_function_name' );
global $wp_filter; // test is register action name with callback function
var_dump($wp_filter);
exit;

Host: 127.0.0.1

Username: root

Password:

Database:

Post: (get from lando info external port)

function memoize(fn) {
return function () {
var args = Array.prototype.slice.call(arguments)
fn.cache = fn.cache || {};
return fn.cache[args] ? fn.cache[args] : (fn.cache[args] = fn.apply(this,args))
}
}
//--------------------------------------------------------------
// EXACTLY
//
// Use this mixin to apply styles when there are exactly a
// given number of elements.
//
// EXAMPLE:
// @include exactly(2, '.menu-item') {
// color: blue;
// }
@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+
"files.associations": {
"*.php": "php",
"*.blade.php" : "blade"
}
@for $i from 1 through 8 {
$width: percentage(1 / $i)
.col-#{$i} {
width: $width;
}
}
@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: {