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 | |
/*** MOCKING ***/ | |
function did_action( $hook ){ | |
static $calls = 0; | |
return $calls++; | |
} |
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 Foo | |
{ | |
const BAR = 'Hallo'; | |
const BAZ = 'Welt!'; | |
/** | |
* | |
* Returns the value of a class constant | |
* @param string $const Name of the constant |
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 Custom_WP_Query extends WP_Query | |
{ | |
public $time_diff = ''; | |
public function __construct( $query = '' ){ | |
if( ! empty( $query ) ) |
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_action( 'save_post', 'clear_many_sites_transient', 10, 1 ); | |
add_action( 'edit_post', 'clear_many_sites_transient', 10, 1 ); | |
function clear_many_sites_transient( $post_id ){ | |
$post = get_post( $post_id ); | |
if( 'page' === $post->post_type ) | |
delete_transient( 'many_sites_in_one' ); |
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
jQuery(document).ready( | |
function($){ | |
resize_thickbox_iframe(); | |
/* | |
* | |
* some other jQuery code | |
* | |
*/ | |
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 Template_Engine_Test | |
{ | |
/** | |
* | |
* Container for the different template-engines | |
* @var object $template_engine | |
*/ | |
public static $template_engine; |
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 | |
/** | |
* | |
* Abstract class WP Simple Templater creates a copy of the template-class and | |
* provide the templates to the template-engine | |
* @author Ralf Albert | |
* | |
*/ | |
abstract class WP_Simple_Templater extends Formatter | |
{ |
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 | |
/** | |
* | |
* Abstract class Wp Simple Templates define one method to retrive the defined templates | |
* @author Ralf Albert | |
* | |
*/ | |
abstract class WP_Simple_Templates | |
{ | |
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 | |
require_once 'class-formatter.php'; | |
require_once 'class-templates.php'; | |
interface Templates | |
{ | |
public function get_templates(); | |
} | |
class Lister extends Formatter |
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 | |
require_once 'class-formatter.php'; | |
class Lister extends Formatter | |
{ | |
public $templates = array(); | |
public function __construct(){ | |
$this->templates = $this->get_templates(); |