Skip to content

Instantly share code, notes, and snippets.

View Kenshino's full-sized avatar

Jon Ang Kenshino

View GitHub Profile
@Kenshino
Kenshino / email_order.php
Last active April 8, 2016 05:41 — forked from mikejolley/gist:1965842
version of email_order_items_table for use outside of the class
<?php
$return = '';
foreach( $order->get_items() as $item ) :
$_product = $order->get_product_from_item( $item );
$file = $sku = $variation = $image = '';
$src = wp_get_attachment_image_src( get_post_thumbnail_id( $_product->id ), 'thumbnail');
<?php
/*
* Plugin Auto Updates Whitelist
* Allows Forced Updates for listed Plugin Slugs
*/
function pb_auto_update_whitelist_plugins( $update, $item ) {
// Array of plugin slugs to whitelist
$plugins = array (
'jetpack',
jQuery(document).ready(function ($) {
// Set the original handler, since we override Core, we need to fall back to core if we're not doing stuff our selves
var _custom_media = true,
_orig_wp_media_insert = wp.media.editor.insert;
// Any input field wit hthe class 'theme_custom_media' will trigger our custom behavior
$(".theme_custom_media").click(function (e) {
var button = $(this);
var id = button.attr('id').replace('_button', '');
<?php
/**
* Class My_Shortcode
*/
class My_Shortcode {
/**
* The shortcode attributes
*
<?php
// domain.com/videos/funny/cute-dogs/
function add_video_post_type() {
$labels = array(
'name' => _x( 'Videos', 'Post Type General Name', 'kibble' ),
'singular_name' => _x( 'Video', 'Post Type Singular Name', 'kibble' ),
'menu_name' => __( 'Videos', 'kibble' ),
pronamicMedia = function(elem, options) {
this.elem = elem;
this.$elem = jQuery(elem);
this.options = options;
};
pronamicMedia.prototype = {
_frame:undefined