Skip to content

Instantly share code, notes, and snippets.

@miziomon
miziomon / functions-theme.php
Created May 3, 2012 12:17
Little collection of WordPress utility
/*
* Apply transient cache and return posts (like get_posts)
*
* @param array $args query params WP_Query
* @param string $transient_name
* @param string $transient_expiration Optional defaul 7200
*/
function cache_posts( $args , $transient_name , $transient_expiration = 7200 ){
if ( false === ( $posts = get_transient( $transient_name ) ) ) {
@miziomon
miziomon / wp-cloudflare-url-replacement.php
Created April 21, 2012 13:08
WordPress CloudFlare Url Replacement
<?php
/*
Plugin Name: CloudFlare URL Replacement
Plugin URI: http://maurizio.mavida.com/wordpress-cloudflare-url-replacement/
Description: Super simle replacer for CloudFlare user.
License: GPL
Version: 0.6
Author: Maurizio Pelizzone
Author URI: http://maurizio.mavida.com