Skip to content

Instantly share code, notes, and snippets.

View jeremyfelt's full-sized avatar
🍕
Look at that pizza emoji!

Jeremy Felt jeremyfelt

🍕
Look at that pizza emoji!
View GitHub Profile
<?php
add_filter( 'pre_set_site_transient_update_core', 'jf_force_autoupdate_response', 10, 1 );
function jf_force_autoupdate_response( $value ) {
if ( isset( $value->updates[0]->response ) && 'upgrade' === $value->updates[0]->response ) {
$value->updates[0]->response = 'autoupdate';
}
return $value;
}
Adding group `postfix' (GID 115) ...
Done.
Adding system user `postfix' (UID 109) ...
Adding new user `postfix' (UID 109) with group `postfix' ...
Not creating home directory `/var/spool/postfix'.
Creating /etc/postfix/dynamicmaps.cf
Adding tcp map entry to /etc/postfix/dynamicmaps.cf
Adding sqlite map entry to /etc/postfix/dynamicmaps.cf
Adding group `postdrop' (GID 116) ...
Done.
INFO global: Vagrant version: 1.4.0
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/help/plugin.rb
INFO global: Vagrant version: 1.4.0
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO manager: Registered plugin: box command
INFO manager: Registered plugin: destroy command
INFO manager: Registered plugin: halt command
INFO manager: Registered plugin: help command
INFO manager: Registered plugin: init command
INFO manager: Registered plugin: package command
INFO manager: Registered plugin: plugin command
<?php
$new_global_ver = 'test';
include( locate_template( 'header.php' ) ); // $new_global_var available to header.php
////////// OR ///////////
get_header( 'test' ); // If one variation is needed, use a different template
////////// OR ////////////
<?php
$prefix = $blog_prefix = '';
if ( ! got_url_rewrite() )
$prefix = '/index.php';
if ( is_multisite() && !is_subdomain_install() && is_main_site() )
$blog_prefix = '/blog';
if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
check_admin_referer('update-permalink');
<?php
// from site-new.php
$user_id = email_exists( $email );
if ( ! $user_id ) { // Create a new user with a random password
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false == $user_id )
wp_die( __( 'There was an error creating the user.' ) );
else
<?php
// $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
add_filter( 'nav_menu_css_class', 'wsuspine_fix_nav_item_classes', 10, 3 );
function wsuspine_fix_nav_item_classes( $classes, $item, $args ) {
if ( in_array( 'current-menu-item', $classes ) )
return array( 'current' );
@jeremyfelt
jeremyfelt / hide-inactive-jetpack-modules.php
Last active December 26, 2015 00:19
Hide inactive Jetpack modules
<?php
/*
Plugin Name: Hide Inactive Jetpack Modules
Plugin URI: https://gist.github.com/jeremyfelt/7062883
Description: Hides Jetpack modules that are marked as inactive, providing for a shorter list.
Version: 0.1
Author: Jeremy Felt
Author URI: http://jeremyfelt.com
License: GPL2
*/