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 Demo_Test extends WP_UnitTestCase { | |
/** | |
* @covers Demo_Plugin::init | |
*/ | |
function test_init() { | |
$demo_plugin = $this->getMockBuilder( 'Demo_Plugin' ) |
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 | |
// only query open forum post types on the forum archive page | |
add_action( 'pre_get_posts', function($query){ | |
if ( ! is_admin() | |
&& ! $query->is_search() | |
&& $query->is_main_query() | |
&& is_post_type_archive('forum') |
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 foo { | |
public static function init(){ | |
add_action('init', array(__CLASS__, 'team_page_metabox'); | |
} | |
/** | |
* Add meta elements if the post type 'page' uses the offering template |
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 | |
add_action( 'save_post', 'myplugin_save_meta_box_data' ); | |
add_action( 'admin_enqueue_scripts', function () { | |
wp_enqueue_media(); | |
} ); | |
add_action( 'add_meta_boxes', 'myplugin_add_meta_box' ); |
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 Incrementer { | |
private $value = 0; | |
public function reset() { | |
$this->value = 0; |
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
rv = -1; // Return value assumes failure. | |
if (navigator.appName == 'Microsoft Internet Explorer') { | |
var ua = navigator.userAgent; | |
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); | |
if (re.exec(ua) != null) | |
rv = parseFloat( RegExp.$1 ); | |
} |
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 | |
$transient_key = 'brand_slider'; | |
$output = get_transient( $transient_key ); | |
if ( false === $results ) : | |
$args = array( | |
'numberposts' => -1, | |
'post_type' => 'program', | |
'meta_key' => 'show_in_brand_slider', |
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
Class Offering { | |
use get; | |
} |
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
// XL screen | |
@screen-xl: 1600px; | |
@screen-xl-min: @screen-xl; | |
@screen-xl-hughdesktop: @screen-xl-min; | |
// So media queries don't overlap when required, provide a maximum | |
@screen-lg-max: (@screen-xl-min - 1); | |
//Container sizes | |
// Large screen / wide desktop |
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 app = app || {}; | |
(function () { | |
app.post = Backbone.Model.extend({ | |
defaults: { | |
ID: null, | |
status: '(default status)', |