Skip to content

Instantly share code, notes, and snippets.

View jtsternberg's full-sized avatar
😎
Awesome Motive-ing

Justin Sternberg jtsternberg

😎
Awesome Motive-ing
View GitHub Profile
@jtsternberg
jtsternberg / instagram-importer-make-title-date.php
Last active April 27, 2016 01:34
Make instagram imported posts' titles to be the date of the imported image
<?php
/*
Plugin Name: DsgnWrks Instagram Importer - Make Title the Image Date
Plugin URI: http://dsgnwrks.pro/plugins/dsgnwrks-instagram-importer
Description: Set the title of your instagram posts to the date the image was taken
Author URI: http://dsgnwrks.pro
Author: DsgnWrks
Donate link: http://dsgnwrks.pro/give/
Version: 0.1.0
*/
@jtsternberg
jtsternberg / modify-google-top-content-query-params.php
Created May 15, 2015 13:45
Modify the google analytics request params in the google top content plugin
<?php
/**
* Change metric from 'ga:pageViews' for top-content widget and shortcode
*
* @link https://ga-dev-tools.appspot.com/query-explorer/ Google's Query Explorer for more info
*
* @param array $params Array of request params
*
* @return array Modified array of request params
*/
@jtsternberg
jtsternberg / CMB2_Search_Get_Extra_Post_Data.php
Last active August 29, 2015 14:27
Update CMB2 Post Search Field to ajax-grab more post-data and use that to populate fields. https://github.com/WebDevStudios/CMB2-Post-Search-field
<?php
/**
* Modify CMB2-Post-Search-Field to output more than just an id
* @link https://github.com/WebDevStudios/CMB2-Post-Search-field
*/
class CMB2_Search_Get_Extra_Post_Data {
protected static $single_instance = null;
@jtsternberg
jtsternberg / download-insta-images-script.md
Last active January 15, 2019 23:24
Script to download high-res images from user's profile on the instagram site
@bradp
bradp / say
Last active September 17, 2015 14:41
say
voices=(
Agnes
Albert
Alex
Alice
Alva
Amelie
Anna
Bad
Bahh
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@jazzsequence
jazzsequence / update.sql
Created February 12, 2016 21:24
Update wp_postmeta and wp_posts database tables with posts from another site
# What if you are trying to migrate a bunch of posts from one site into
# another site that already has content? We'll assume you already have
# a database export of the posts and postmeta you want to migrate. You
# will want to create a database locally to alter the tables to get them
# ready to merge into the production database that already has content.
# You will also need to know the highest `meta_id` and `ID` values from
# the `wp_postmeta` and `wp_posts` tables, respectively.
# First, we need to create new columns in the tables we have locally. To
# do this the right way, we are going to figure out what type of data
@jazzsequence
jazzsequence / cmb2_add_field.sublime-snippet
Last active July 11, 2016 21:21
Sublime Text snippets
<snippet>
<content><![CDATA[
->add_field( array(
'name' => __( '${1:Field Name}', '${2:textdomain}' ),
'id' => \$prefix . '${3:field_id}',
'type' => '${4:cmb2_field_type}',
'desc' => __( '${5:Description of the field.}', '${2:textdomain}' ),
${6:'options' =>} ${7:${8:array of options or callback function},}
${9:'attributes' =>} ${10:${11:array of attributes},}
${12:'default' =>} ${13:'${14:default_value}',}
@jtsternberg
jtsternberg / affection.js
Last active June 9, 2016 20:17
copy me to your console.
alert( [+[++[+[]][+[]]+[]+[[]+[][+[]]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]]+[++[+[]][+[]]+[]][+[]]+[+[]]+[+[]]+[+[]]][+[]]+[]][+[]][+[]]+' <'+ ++[++[++[[]][+[]]][+[]]][+[]] +' '+[[][+[]]+[]][+[]][+[]] )
@jtsternberg
jtsternberg / gtc_list_item_add_excerpt.php
Last active January 17, 2017 03:21
Add excerpt to results from Google Analytics Top Content Widget
<?php
/**
* Add the post excerpt to the results in the Google Analytics Top Content Widget.
*
* @param string $item_html The item html.
* @param array $page The page result object from Google Analytics.
* @param WP_Post|null $wppost The WordPress post object (if we have it).
*
* @return string The modified item html.
*/