Skip to content

Instantly share code, notes, and snippets.

@Rahe
Rahe / filter.php
Created May 22, 2016 08:20
Disable Simple Image Sizes featured image regeneration button
<?php
add_filter( 'SIS/Admin/Post/Display_Thumbnail_Regenerate', '__return_false' );
@Rahe
Rahe / postmessage.js
Created June 17, 2016 13:19
PostMessage
var origin = null;
if(window.addEventListener) {
window.addEventListener('message', onMessage, false);
} else {
window.attachEvent('onmessage', onMessage);
}
function onMessage(e) {
if(referer !== undefined && e.origin === referer) {
@Rahe
Rahe / cron-mu-cli.sh
Last active December 18, 2016 11:28
Run all cron due cron events on multisite
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "You need to pass the url of the site. Usage ./cron-mu-cli.php http://mysite.fr"
exit
fi
for url in $( wp site list --field=url --url=$1 )
do
@Rahe
Rahe / example.php
Created October 26, 2018 15:00
Codeception
<?php
// Create fake resource
$resource = new \StdClass();
$resource->card = new \StdClass();
$resource->card->id = 1;
$resource->card->last4 = '3333';
$resource->card->exp_year = '2019';
$resource->card->exp_month = '01';
$resource->card->brand = 'mastercard';