Skip to content

Instantly share code, notes, and snippets.

View turtlepod's full-sized avatar
🎧
Working from home

David Chandra Purnama turtlepod

🎧
Working from home
View GitHub Profile
@turtlepod
turtlepod / listing-labels.min.js
Created August 9, 2017 05:59
Listing Labels JS without History JS
/**
* Filter by labels.
*
* @since 2.0.0
*/
(function( window, undefined ) {
window.wp = window.wp || {};
var document = window.document;
<?php
/**
* WC Meta Data ~ How to do this in WooCommerce 3 ?
*
* @link https://stackoverflow.com/questions/45540351/woocommerce-3-crud-how-to-do-this
*
* @link https://github.com/woocommerce/woocommerce/wiki/CRUD-Objects-in-3.0
*/
add_action( 'plugins_loaded', function() {
if ( ! class_exists( 'WooCommerce' ) ) {
.ion-alert-circled:before {
background-image: url( "data:image/svg+xml;charset=utf8,%3C%21--%20Generated%20by%20IcoMoon.io%20--%3E%0A%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%3E%0A%3Ctitle%3Eion-alert-circled%3C%2Ftitle%3E%0A%3Cpath%20d%3D%22M27.813%2026.375c0.188%200.313%200.313%200.813%200.125%201.125s-0.5%200.5-0.875%200.5h-26.125c-0.375%200-0.688-0.188-0.875-0.5s-0.063-0.813%200.125-1.125l12.938-21.813c0.188-0.313%200.5-0.563%200.875-0.563s0.688%200.25%200.875%200.563zM16%2025v-3h-4v3h4zM16%2020v-9h-4v9h4z%22%3E%3C%2Fpath%3E%0A%3C%2Fsvg%3E%0A" );
}
.ion-alert:before {
background-image: url( "data:image/svg+xml;charset=utf8,%3C%21--%20Generated%20by%20IcoMoon.io%20--%3E%0A%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%2232%22%20viewBox%3D%220%200%208%2032%22%3E%0A%3Ctitle%3Eion-alert%3C%2Ftitle%3E%0A%3Cpath%20d%3D%22M8%2030h-
@turtlepod
turtlepod / export.js
Last active April 8, 2020 15:49
Export-Import GitHub Labels
/**
* Export Github Labels
****************************************************
*
* FIREFOX STEP BY STEP:
* 1. Open the labels manage page e.g github.com/user/repo/lebels
* 2. Open Scratch Pad (SHIFT + F4)
* 3. Paste the code below and run
* 4. Inspect Element > Console ( To read console log)
* 5. Copy it the console.log results
<?php
/**
* GitHub webhook handler template.
*
* @see https://developer.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
@turtlepod
turtlepod / functions.php
Created August 20, 2016 05:12 — forked from tripflex/functions.php
Automatically set/assign parent taxonomy terms for hierarchical taxonomies in WordPress
<?php
add_action( 'set_object_terms', 'auto_set_parent_terms', 9999, 6 );
/**
* Automatically set/assign parent taxonomy terms to posts
*
* This function will automatically set parent taxonomy terms whenever terms are set on a post,
* with the option to configure specific post types, and/or taxonomies.
*
.wp-audio-shortcode {
max-width:100%;
margin-bottom: 20px;
}
@turtlepod
turtlepod / meta-box-class.php
Last active December 27, 2015 15:39
Simple Meta Box Helper Class
<?php
/* Prevent loading this file directly and/or if the class is already defined */
if ( ! defined( 'ABSPATH' ) || class_exists( 'SC_Plugin_Meta_Box_Class' ) )
return;
/**
* Shellcreeper Meta Boxes Class
* Helper class to easily create meta boxes in post edit screen with Meta Box API.
* Rename this class name if you use it in your plugin/theme.
@turtlepod
turtlepod / gist:5921837
Created July 3, 2013 19:15
Hybrid Base functions.php with link to Docs
<?php
/**
* The functions file is used to initialize everything in the theme. It controls how the theme is loaded and
* sets up the supported features, default actions, and default filters. If making customizations, users
* should create a child theme and make changes to its functions.php file (not this one). Friends don't let
* friends modify parent theme files. ;)
*
* Child themes should do their setup on the 'after_setup_theme' hook with a priority of 11 if they want to
* override parent theme features. Use a priority of 9 if wanting to run before the parent theme.
*
@turtlepod
turtlepod / gist:5378353
Created April 13, 2013 13:13
Shell Editor CSS custom markup. Need to remove this from shell somehow....
/**
* Shell Content Editor CSS
* =========================
*/
/* Note */
.note {
padding: 6px 9px;
background: #eee;
border: 1px solid #ccc;