We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
<?php | |
/* | |
* dl-file.php | |
* | |
* Protect uploaded files with login. | |
* | |
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
* | |
* @author hakre <http://hakre.wordpress.com/> | |
* @license GPL-3.0+ |
/* | |
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
* | |
* Usage: | |
* $ casperjs screenshots.js http://example.com | |
*/ | |
var casper = require("casper").create(); |
<?php | |
function my_single_template_by_post_id( $located_template ) { | |
return locate_template( array( sprintf( "single-%d.php", absint( get_the_ID() ) ), $located_template ) ); | |
} | |
add_filter( 'single_template', 'my_single_template_by_post_id' ); |
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
<?php | |
/** | |
* @Given /^I am viewing a product with the following related products:$/ | |
*/ | |
public function assertRelatedProducts(TableNode $relatedProducts) { | |
// First, create a product. | |
$product = (object) array( | |
'title' => 'Parent Product', | |
'type' => 'product', | |
'uid' => 1, |
<?php | |
/* | |
* Blog Comments in Buddypress Activity | |
* WARNING: Test thoroughly if it works in your environment before using in production code. | |
* LICENSE: Public domain | |
*/ | |
/* | |
* When a new comment gets added to the database, add this comment to the |
<?php | |
use Behat\Behat\Context\ClosuredContextInterface, | |
Behat\Behat\Context\TranslatedContextInterface, | |
Behat\Behat\Context\BehatContext, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; | |
/** |
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-min-and-max-character-limit.php | |
*/ | |
/** | |
* Gravity Wiz // Require Minimum Character Limit for Gravity Forms | |
* | |
* Adds support for requiring a minimum number of characters for text-based Gravity Form fields. |
<?php | |
/** | |
* custom_tinymce | |
*/ | |
function vpm_custom_tinymce( $settings ) { | |
// Define our custom formats | |
$style_formats = array( | |
array( |