This file contains 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 regions { | |
static function initialize() | |
{ | |
// We need to process the_content as early as possible, to be sure that DOM tree identical to edited one | |
// Also, function accept 2 arguments, so when needed we can supply exact regions to apply | |
if ( !is_admin() ) { // We don't want to run this on the backend | |
if (true) { // until apply_filter use current()/next() | |
add_filter('the_content', array(self::instance(), 'content_split_join'), -99991, 2); | |
} else { |
This file contains 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 | |
add_filter( 'the_content', 'my_content_filter' ); | |
/** | |
* Auto appends the content of child posts to the main post | |
*/ | |
function my_content_filter( $content ) { | |
global $post; |
This file contains 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 | |
/** | |
* Outputs the current weather conditions | |
*/ | |
function ocj_weather() { | |
$conditions = get_transient( 'current_weather' ); | |
if ( false === $conditions ) { | |
$key = '771f294942a9ba11'; | |
$current = 'http://api.wunderground.com/api/' . $key . '/conditions/q/OH/Columbus.json'; |
This file contains 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 | |
/** | |
* header.php | |
*/ | |
?><!DOCTYPE html> | |
<html <?php language_attributes(); ?>> | |
<head> | |
<!-- meta tags and such omitted for brevity --> |
This file contains 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
(function (window, $, thirdyo ) ) { | |
var mycallbackfunction = function() {} | |
thirdyo.thirdpartyfunction( mycallbackfunction ); | |
})(window, jQuery, thirdyo ); |
This file contains 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
( function( window, undefined ) { | |
var Logger = function() { | |
var SELF = this, | |
log = []; | |
SELF.append = function( data ) { | |
log.push( data ); | |
}; | |
SELF.getData = function() { |
This file contains 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 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 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 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' ); |