Skip to content

Instantly share code, notes, and snippets.

View mboynes's full-sized avatar

Matthew Boynes mboynes

View GitHub Profile
@mboynes
mboynes / class-pointers.php
Created September 5, 2012 14:10
Multisite tracking popup fix
<?php
/**
* @package Admin
*/
/**
* This class handles the pointers used in the introduction tour.
*
* @todo Add an introdutory pointer on the edit post page too.
*/
global $wpdb;
$rows = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id FROM wp_blogs where blog_id > 1" ) );
foreach( $rows as $row ) {
print_r( "siteid ".$row->blog_id );
}
<?php
add_action('publish_post', 'schedule_glossary_index', 10, 1);
function schedule_glossary_index($post_id) {
wp_schedule_single_event(time(), 'update_glossary_index', array( $post_id ));
}
add_action('update_glossary_index', 'do_update_glossary_index', 10, 1);
function do_update_glossary_index($post_id) {
global $wpdb;
@mboynes
mboynes / sitemap-builder.php
Created February 9, 2012 00:05
Google XML Sitemaps Generator for WordPress 4.0beta8 Custom Post Type Fix
<?php
/*
$Id: sitemap-builder.php 420059 2011-08-06 14:31:30Z arnee $
*/
/**
* Default sitemap builder
*
* @author Arne Brachhold