Skip to content

Instantly share code, notes, and snippets.

View drrobotnik's full-sized avatar

Brandon drrobotnik

  • ThermoFisher Scientific
  • San Diego
View GitHub Profile
/**
* Open a preview e-mail.
*
* @return null
*/
function previewEmail() {
if (is_admin()) {
$default_path = WC()->plugin_path() . '/templates/';
(function($) {
$(function() {
// Lightbox
$("a.zoom").prettyPhoto({
hook: 'data-rel',
social_tools: false,
theme: 'pp_woocommerce',
horizontal_padding: 20,
opacity: 0.8,
/*------------------------------------*\
@CSSWIZARDRY-GRIDS
\*------------------------------------*/
/**
* CONTENTS
* VARIABLES............Your settings.
* GRID SETUP...........Build the grid structure.
* WIDTHS...............Build our responsive widths around our breakpoints.
*/
@drrobotnik
drrobotnik / gist:b1bbe34766f129171b02
Created September 30, 2014 16:50
Use Woo Admin Reports
include_once(ABSPATH . 'wp-content/plugins/woocommerce/includes/admin/reports/class-wc-admin-report.php');
$report = new WC_Admin_Report();
$start_date = get_field('campaign_start_date', $campaign->ID);
$end_date = get_field('campaign_end_date', $campaign->ID);
$report->start_date = strtotime($start_date);
$report->end_date = strtotime($end_date);
@lap-start: 481px;
@desk-start: 1024px;
@palm-end: @lap-start - 1px;
@lap-end: @desk-start - 1px;
function cv_twitter_get( $method='', $args=array() ){
$implode_args = implode('_', $args);
$sani_method = sanitize_title_with_dashes( $method );
$sani_args = sanitize_title_with_dashes( $implode_args );
$transient = $sani_method . '_' . $sani_args;
// avoid rate limiting
/**
* On the fly image cropping based on WP 3.5 image editor
*
* @param int $id
* @param int $width
* @param int $height
* @param boolean $crop
*
* @return string
*/
add_action( 'wp_ajax_tt_action', 'tt_action_callback' );
add_action( 'wp_ajax_nopriv_tt_action', 'tt_action_callback' );
function tt_action_callback() {
$args = $_POST['query_args'];
$args['posts_per_page'] = 10;
$args['post_status'] = 'publish';
$args['suppress_filters'] = true;
$args['cache_results'] = false;
/**
* Add theme support for infinite scroll.
*
* @uses add_theme_support
* @return void
*/
function gh_infinite_scroll_init() {
add_theme_support( 'infinite-scroll', array(
'container' => 'isoblock',
<?php
if ( ! function_exists( '_s_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function _s_posted_on() {
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}