This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
author: jeedo aquino | |
file: wp-index-redis.php | |
credit: jim westergren | |
updated: 2012-10-23 | |
this is a redis caching system for wordpress inspired by jim westergren. | |
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom Hacks for PDXWP Meetup | |
*/ | |
/** | |
* Clean up the output of the <head> block | |
*/ | |
function pdxwp_clean_header() { | |
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyTestClass extends PHPUnit_Framework_TestCase { | |
public function setUp() { | |
\WP_Mock::setUp(); | |
} | |
public function tearDown() { | |
\WP_Mock::tearDown(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fb_request_url = 'http://api.facebook.com/restserver.php'; | |
$fb_request_url = add_query_arg( | |
array( | |
'method' => 'links.getStats', | |
'urls' => $url | |
), | |
$fb_request_url | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function update_wppa_list_limit( $current ) { | |
return 5; | |
} | |
add_filter( 'wppa_list_limit', 'update_wppa_list_limit' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loadPosts = document.getElementById( 'loadposts' ), | |
loadPostsA = loadPosts.querySelectorAll( 'a' ), | |
$loadPosts = $( loadPosts ), | |
$loadPostsA = $( loadPostsA ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load posts | |
var loadPosts = document.getElementById( 'loadposts' ), | |
$loadPostsA = $( loadPosts.querySelectorAll( 'a' ) ), | |
$articles = $( document.getElementById( 'articles' ) ); | |
$loadPostsA.on( 'click', function(e) { | |
e.preventDefault(); | |
var $this = $( this ); | |
$this.html( 'Loading…' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function add_img_titles( $content ) { | |
global $post; | |
preg_match_all( '/<img[^>]*>/', $content, $matches ); | |
$replacements = array(); | |
foreach( $matches[0] as $match ) { | |
// If this image has a title, skip it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Interface | |
inferface ArchiveElement { | |
public function do_something(); | |
} | |
class TC_Video implements ArchiveElement { | |
public function do_something() { | |
// does something | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 10, | |
'meta_query' => array( | |
'relation' => 'OR', | |
array( | |
'key' => 'has_been_twittered', | |
'value' => 'no', |