Skip to content

Instantly share code, notes, and snippets.

@mikemanger
mikemanger / update-wp-multisite-domain.sql
Created March 10, 2014 16:23
Run this for each wp_*_options table.
UPDATE wp_x_options
SET option_value = REPLACE(option_value, 'old.domain.com', 'new.domain.com')
WHERE option_name = 'siteurl'
OR option_name = 'home'
OR option_name = 'fileupload_url';
@mikemanger
mikemanger / wp-change-title-placeholder.php
Created February 6, 2014 17:22
Add to WordPress theme's functions.php or plugin. Changes the 'Enter title here' text for certain post types (most examples don't realise you can get the post type from the filter.
/**
* Change the title placeholder text
*/
function my_plugin_change_default_title( $title, $post ){
if ( 'posttype' == $post->post_type ) {
$title = 'Enter new title here';
}
return $title;
}
@mikemanger
mikemanger / postcode-anywhere-example.js
Last active December 31, 2015 20:09
Postcode Anywhere Capture+ hooks
function CapturePlusLoaded(control) {
// Search results
control.listen('populate', function(control, address, variations) {
// Code here
});
// Error results
control.listen('error', function(control, error) {
// Code here
@mikemanger
mikemanger / .bashrc
Created September 19, 2013 10:57
I always type `git branches` instead of `git branch` to list my branches, copy this to your .bashrc
# git function for branches
git() { if [[ $@ == "branches" ]]; then command git branch | more; else command git "$@"; fi; }