Instantly share code, notes, and snippets.

View Git push deployment in 7 easy
View WP_DEBUG.php
//For public debugging logs to file in wp_content
//add the following to your wp-config.php by the bottom of the file where is says /* That's all, stop editing! Happy blogging. */
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);
define('SCRIPT_DEBUG', true);
define('JETPACK_DEV_DEBUG', true);
define( 'SAVEQUERIES', true );
View contact-form-7-url-filter.php
add_filter('wpcf7_form_action_url', 'wpcf7_custom_form_action_url');
function wpcf7_custom_form_action_url($url) {
global $post;
// Change the value of $id_to_change to the post id where the form is
$id_to_change = 1;
View display-rewrites.php
function jb_show_rewrite_rules() {
$rules = get_option('rewrite_rules');
$n = 0;
$html = '<table><tr><th style="width: 5%;">#</th><th style="width: 35%;">Key</th><th style="width: 60%;">Rule</th></tr>';
foreach ( $rules as $key => $value ) {
$html .= '<tr><td>' . ++$n . '</td><td>' . $key . '</td><td>' . $value . '</td></tr>';
} // end foreach
View disable-heartbeat.php
// Also available in a plugin
add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
# Customized by Jeff Behnke @topdown on GitHub
# This file is a custom provision script for VVV that skips all updates and update checks
# It only does the absolute tasks that I know are needed for vagrant up, vagrant reload, vagrant provision and vv create
# It currently runs vagrant provision tasks in roughly 8 secs.
# You should be using VV for creating sites, then replace its with this one once you have a working VVV system.
View wp-bin-example.php
// Don't load theme data IE css and other features
define( 'WP_USE_THEMES', false );
* Loads the WordPress Environment and Template
* Change PATH_TO_WP to the path of the following file
require( 'PATH_TO_WP/wp-blog-header.php' );
View cron.php
// This code can go anywhere as long as its loaded by a plugin or theme
// setup the schedual
if ( ! wp_next_scheduled( 'my_task_hook' ) ) {
wp_schedule_event( time(), 'hourly', 'my_task_hook' );
add_action( 'my_task_hook', 'my_task_function' );
# Not saying this is a fix all, but this is what I had to do to get VVV running properly on my system.
# It failed to install properly do to script errors
# Branch master
# head 7f5411455573bba88d8ce232db957c62b11977f5
# VVV Update issues
vagrant ssh
View Gruntfile.js
'use strict';
module.exports = function (grunt) {
// load all grunt tasks matching the `grunt-*` pattern
var $proxy = '';