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 | |
define( 'WP_TESTS_PATH', '<Enter the path to your unit-tests checkout>' ); | |
$GLOBALS['wp_tests_options'] = array( | |
'active_plugins' => array( '<plugindir/<plugin>.php' ), | |
); | |
require rtrim( WP_TESTS_PATH, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . 'bootstrap.php'; |
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
/* pop me into your functions.php */ | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', ("http://code.jquery.com/jquery-git.js"), false, '1.8.2'); | |
wp_enqueue_script('jquery'); |
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
<!-- Featuring three books on a site's homepage --> | |
<!-- The Pods/WordPress way --> | |
<ul id="featured-books"> | |
<?php | |
$book = new Pod('book'); | |
$params = array( | |
'where'=>'t.show_on_homepage = 1', |
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 | |
wp_enqueue_style( 'pods-select2' ); | |
wp_enqueue_script( 'pods-select2' ); | |
$attributes = array(); | |
$attributes[ 'tabindex' ] = 2; | |
$pick_limit = (int) pods_var( 'pick_limit', $options, 0 ); | |
$name .= '[]'; | |
$attributes[ 'multiple' ] = 'multiple'; | |
if ( !is_array( $options[ 'data' ] ) && false !== $options[ 'data' ] && 0 < strlen( $options[ 'data' ] ) ) |
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
<script type="text/html" id="tmpl-soliloquy-attachment-fields"> | |
<label class="setting" data-setting="soliloquy_link"> | |
<div><# console.log(data) #></div> | |
<span><?php echo Tgmsp_Strings::get_instance()->strings['image_link']; ?></span> | |
<input type="text" value="{{ data.soliloquy_link }}" /> | |
</label> | |
</script> |
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 | |
/* | |
* Plugin Name: Hacky Taxonomy Archives | |
* Description: Don't use this on a live site, plz. Proof of concept for Aaron Holbrook. | |
* Author: Andrew Nacin | |
*/ | |
add_action( 'template_redirect', function() { | |
global $wp_rewrite; | |
$taxonomy = 'fruits'; |
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 | |
/** | |
* A `print_r` or `var_dump` replacement that expands the variable into valid PHP code. | |
* @uses var_export | |
* @param array|object $array_or_object $variable to expand/view | |
* @param boolean $echo Whether to return or display the data | |
* @return string Variable representation that is valid PHP code. | |
*/ | |
function expand_code( $array_or_object, $echo = true ) { |
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 | |
/** | |
* Helper function for insert and replace. | |
* | |
* Runs an insert or replace query based on $type argument. | |
* | |
* @access private | |
* @since 3.0.0 | |
* @see wpdb::prepare() | |
* @see wpdb::$field_types |
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 | |
/** | |
* Post Meta Box view/controller class. | |
* | |
* Extends from a form object base class. | |
* | |
* Creates a meta box. Fields can be related to the meta box, but | |
* all business logic lives within the field object. | |
*/ |
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 CWS_Jetpack_Modules { | |
function __construct() { | |
add_filter( 'option_jetpack_active_modules', array( $this, 'active_modules' ) ); | |
} | |
function active_modules( $modules ) { | |
$allowed_modules = array( | |
'enhanced-distribution', |
OlderNewer