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('current_screen', 'jpb_current_screen'); | |
/** | |
* @param WP_Screen $screen The current screen object | |
*/ | |
function jpb_current_screen($screen){ | |
if($screen->post_type === 'my_custom_post_type'){ | |
$screen->add_help_tab(array( |
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 | |
namespace Alpha\Beta\Gamma\Base\Echo; | |
use Alpha\Beta\Gamma\Base; | |
class Foxtrot extends Base\Echo | |
{ | |
} |
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 remove_filter_by_classname( $filter, $classname, $priority ) { | |
global $wp_filter; | |
$match = false; | |
if( !empty( $wp_filter[$filter] ) && !empty( $wp_filter[$filter][$priority] ) ) { | |
foreach( $wp_filter[$filter][$priority] as $added_filter ) { | |
if( is_array( $added_filter['function'] ) && get_class( $added_filter['function'][0] ) === $classname ) { | |
$match = $added_filter; | |
break; |
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 Loopable_Query extends WP_Query implements Iterator { | |
/** | |
* (PHP 5 >= 5.0.0)<br/> | |
* Return the current element | |
* @link http://php.net/manual/en/iterator.current.php | |
* @return mixed Can return any type. | |
*/ |
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
curl https://github.com/WordPress/WordPress/compare/3.5...3.5.1.patch | patch -p1 |
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 testsbygroup(){ | |
# Grab a list of groups | |
groups=`phpunit --list-groups | sed -rn 's/ - (.+)/\1/p'` | |
if [[ ! $groups ]]; then | |
return 1 | |
fi | |
# Set up some empty arrays | |
pass=() | |
incomplete=() |
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
{ | |
"name": "your-name/your-project", | |
"require": { | |
"php": ">=5.3.2" | |
}, | |
"require-dev": { | |
"mockery/mockery": "dev-master@dev", | |
"hamcrest/hamcrest": "1.1.0" | |
}, | |
"repositories": [ |
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
{ | |
"name": "phpunit", | |
"description": "PHPUnit Composer Package", | |
"require": { | |
"phpunit/phpunit": "3.7.*" | |
}, | |
"config": { | |
"bin-dir": "/usr/local/bin/" | |
} | |
} |
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
config.vm.provision :puppet do |puppet| | |
# Add a folder in your root named .ppt | |
puppet.manifests_path = ".ppt/manifests" | |
# vagrant.pp is your main manifest and goes in .ppt/manifests | |
puppet.manifest_file = "vagrant.pp" | |
# Add puppet modules in .ppt/modules as git submodules; they will be pre-installed in Vagrant this way | |
puppet.module_path = ".ppt/modules" | |
# Config files, etc. go in .ppt/files. fileserver.conf (see below) defines the path for puppet to add | |
# when looking for files. That way, you can reference files with puppet:// protocols. Make sure you | |
# add the directory defined in fileserver.conf as a shared directory in the main Vagrantfile config |