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
jQuery(document).ready(function($) {
/** ColorBox Setup Functions **/
function colorboxInit() {
var popup = $('.pop');
var params = {
width: 1200,
height: 910,
opacity: 0.7,
@jtsternberg
jtsternberg / very basic comment importing for DsgnWrks Instagram Importer
Created December 19, 2012 17:04
very basic comment importing for DsgnWrks Instagram Importer
add_filter( 'dsgnwrks_instagram_post_save', 'my_post_save_function', 10, 2 );
function my_post_save_function( $post_id, $pics ) {
// Attach comments, if any
foreach ( $pics->comments->data as $instagram_comment ) {
$comment = array(
'comment_post_ID' => $post_id,
'comment_author' => $instagram_comment->from->username,
'comment_author_url' => 'http://instagram.com/'. $instagram_comment->from->username,
'comment_content' => $instagram_comment->text,
<?php
add_filter( 'dsgnwrks_instagram_post_save', 'my_post_save_function', 10, 2 );
function my_post_save_function( $post_id, $pics ) {
// Attach comments, if any
foreach ( $pics->comments->data as $instagram_comment ) {
$comment = array(
'comment_post_ID' => $post_id,
'comment_author' => $instagram_comment->from->username,
'comment_author_url' => 'http://instagram.com/'. $instagram_comment->from->username,
@jtsternberg
jtsternberg / Very-basic-comment-importing-for-DsgnWrks-Instagram-Importer.php
Created December 19, 2012 17:05
Very basic comment importing for DsgnWrks Instagram Importer
<?php
add_filter( 'dsgnwrks_instagram_post_save', 'my_post_save_function', 10, 2 );
function my_post_save_function( $post_id, $pics ) {
// Attach comments, if any
foreach ( $pics->comments->data as $instagram_comment ) {
$comment = array(
'comment_post_ID' => $post_id,
'comment_author' => $instagram_comment->from->username,
'comment_author_url' => 'http://instagram.com/'. $instagram_comment->from->username,
jQuery(document).ready(function($){
/* Check for Ajax new "Show" addition */
$('body').ajaxComplete(function(e, xhr, settings) {
// Verify we're in the correct Ajax action
if (typeof settings !== 'undefined' && typeof settings.action !== 'undefined' && settings.action == 'add-shows') {
// get new show data
var name = $.trim($($("#showschecklist input:checked")[0]).parent().text());
var value = $($("#showschecklist input:checked")[0]).val();
// Takes you to the site's base url and appends '/wp-admin'
javascript:(function(){ var url = !window.location.origin ? window.location.protocol+'//'+window.location.host : window.location.origin; window.open(url+'/wp-admin'); })();
<?php
add_action( 'pre_get_posts', 'badgeos_filter_front_query' );
/**
* Exclude hidden items
*/
function badgeos_filter_front_query( $query ) {
$user_earned = badgeos_get_user_earned_ids();
$not_in = badgeos_get_hidden_ids();
@jtsternberg
jtsternberg / dsgnwrks-instagram-importer-debug.php
Created March 21, 2013 15:25
require another plugin & deactivate
<?php
/*
Plugin Name: DsgnWrks Instagram Importer Debug
Plugin URI: http://dsgnwrks.pro/plugins/dsgnwrks-instagram-importer-debug
Description: Enables a debug mode option for troubleshooting issues with the DsgnWrks Instagram Importer plugin
Author URI: http://dsgnwrks.pro
Author: DsgnWrks
Donate link: http://dsgnwrks.pro/give/
Version: 0.1
*/
Index: nbc-jetpack-slideshow-mod/jetpack-slideshow.css
===================================================================
--- nbc-jetpack-slideshow-mod/jetpack-slideshow.css (revision 942)
+++ nbc-jetpack-slideshow-mod/jetpack-slideshow.css (working copy)
@@ -48,7 +48,7 @@
}
.slideshow-line-height-hack {
- overflow: hide;
+ overflow: none;
@jtsternberg
jtsternberg / taxonomy-radio-metabox.php
Last active April 12, 2020 05:12
Removes and replaces the built-in taxonomy metabox with our radio-select metabox.
<?php
if ( !class_exists( 'WDS_Taxonomy_Radio' ) ) {
/**
* Removes and replaces the built-in taxonomy metabox with our radio-select metabox.
* @link http://codex.wordpress.org/Function_Reference/add_meta_box#Parameters
*/
class WDS_Taxonomy_Radio {
// Post types where metabox should be replaced (defaults to all post_types associated with taxonomy)