Posted on August 3, 2016
WooCommerce: Allow adding multiple products to the cart via the add-to-cart query string
If you’re not familiar, WooCommerce offers a way to link to the checkout/cart page and automatically add a product to the cart (h/t Justin). You can create a link like so: I recently (somewhat annoyingly) discovered that while that works fairly… Read More
Posted on September 3, 2015
Script to Download High-Resolution Images from Instagram’s Website
For some unknown reason, at this time, Instagram does not offer a way to consume the raw images from their API. This means that the max-resolution available over the API is 612×612. This also means that those nifty… Read More
Better Javascript, a WDSLunch presentation
In March, I (re)presented on some of the fundamentals of writing better javascript for an internal WDSLunch presentation. The slides contain a ton of useful info and are an accumulation of a lot of tips & tricks I’ve learned along the way. I definitely recommend checking them out. The two resource slides at the end are gold. dsgnwrks.pro/wdslunch-better-javascript
Posted on March 24, 2015
WordPress admin bar tweaks for extremely large networks
WordPress multisite is an awesome tool, but has its limitations and caveats, ESPECIALLY when you’re dealing with very large networks. At WebDevStudios, we use this snippet to prevent the ‘My Sites’ menu from querying every site on the… Read More
Posted on March 4, 2015
A function timer… function
Handy function that calculates your function/method execution time so you can optimize your code’s performance.
Posted on December 20, 2014
Host your code snippets in WordPress, and embed them in your content — Enter Code Snippets CPT
Code Snippets CPT is a WordPress plugin for managing and displaying code snippets. It adds a custom post type for managing your code snippets with taxonomies for classifying the snippets. But what’s a snippet if you can’t display it? Syntax… Read More
Posted on October 10, 2014
Make custom post type edit page one column
Just a quick snippet. In case you need to make a custom post type screen be one column, you need to add/modify two filters. This example uses CPT_Core:
Posted on August 23, 2014
Sending a server-side (WordPress/PHP) development environment variable to your scripts
This is written for PHP and/or WordPress, but the principle applies to any server-side language. First we’ll we’ll create a php function for determining our environment: This function will return 1 for production, 2 for your staging environment,… Read More
Posted on October 2, 2013
A print_r() or var_dump() replacement that expands the variable into valid PHP code.
Occasionally you want to expand an object or array variable to see what it contains. Typically we would use a variation of print_r() or var_dump() to do this, but the down side is there is no way simple way… Read More
Recent Comments