Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
mikeschinkel / parks-and-features.php
Created November 5, 2011 23:16
Plugin demonstrates how to route parent post/child post URLs WordPress 3.3
<?php
/**
* Plugin Name: MMC Parks and Features
* Description: This plugin demonstrates how to route parent/child URLs like http://example.com/parks/yosemite/half-dome/in WordPress 3.3
* Author: Mike Schinkel
* Author URL: http://about.me/mikeschinkel
* Notes:
* To answer http://lists.automattic.com/pipermail/wp-hackers/2011-November/041486.html
* Assumes a metabox that sets $post->post_parent field for a park feature with it's park's $post->ID.
*
@ammist
ammist / change_urls.sql
Created August 31, 2011 07:28
MySQL Wrangling
-- handy for moving a database from prouction to your local environment.
-- change URL's in wordpress single-site install. Replace with your own URL's.
-- this doesn't address serialized options.
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "home";
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "siteurl";
update wp_postmeta set meta_value = replace(meta_value, 'http://example.com', 'http://localhost:8888') where meta_key='_menu_item_url';
update wp_posts set post_content = replace(post_content, 'http://example.com', 'http://localhost:8888');
@markjaquith
markjaquith / README.md
Created August 16, 2011 19:33
TLC Transients — On the fly WordPress transients with soft expiration and one-liner chained syntax.
@scribu
scribu / cpt-redirect.php
Created July 27, 2011 22:49
CPT Redirect
<?php
define( 'MY_CPT', 'actor' );
/**
* Redirects /cary-grant/ to /actor/cary-grant/ or whatever the correct URL is
*/
function redirect_old_cpt_urls() {
if ( !is_404() )
return;
@doolin
doolin / svn_overwrite.sh
Created June 15, 2011 15:19
svn overwriting a WordPress installation
#!/usr/bin/sh
# This script will overwrite an existing
# WordPress installation with the current
# head of trunk. Once it has been reverted,
# you may need to update the database, and
# WP will prompt you for that automatically.
# This is untested with these options!
# The script commands work from the command
@kirkegaard
kirkegaard / install_wordpress.sh
Created March 16, 2010 10:44
install wordpress from a selected source
#!/bin/bash
CURRENT_PATH=`pwd`
INSTALL_FOLDER="public_html"
METHOD="HTTP"
HTTP_SOURCE="http://wordpress.org/latest.tar.gz"
SVN_SOURCE=""
SVN_SOURCE_BASE="http://core.svn.wordpress.org"
SVN_SOURCE_STABLE="/tags/2.9.2/"
SVN_SOURCE_TRUNK="/trunk/"