Skip to content

Instantly share code, notes, and snippets.

@Coopeh
Coopeh / README.md
Created April 22, 2012 21:48
Set options for all WordPress Multisite blogs
@Coopeh
Coopeh / class.email-post-changes.php.diff
Created May 16, 2012 23:06
class.email-post-changes.php.diff
33d32
< 'post_ids' => array(),
182,198d180
< $options = $this->get_options();
< $ids = explode(",", $options['post_ids']);
<
< if (in_array($this->right_post->ID, $ids)){
<
< // Send email
< $charset = apply_filters( 'wp_mail_charset', get_option( 'blog_charset' ) );
@Coopeh
Coopeh / class.email-post-changes.php
Created May 16, 2012 23:08
class.email-post-changes.php
<?php
class Email_Post_Changes {
var $defaults;
var $left_post;
var $right_post;
var $text_diff;
@Coopeh
Coopeh / disable-plugins-when-doing-local-dev.php
Created May 22, 2012 16:23 — forked from johnpbloch/disable-plugins-when-doing-local-dev.php
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@Coopeh
Coopeh / ms.php
Last active October 6, 2015 05:58
ms.php modification
$my_title = 'My Blogs › PrimaryBlogger';
wp_die( $output, $my_title, array('response' => 200) );
@Coopeh
Coopeh / gist:2947789
Created June 18, 2012 10:30
Query WPMU Comment Count For A List Of Blogs
/* DB init */
global $wpdb;
/* Get current user details and declare variables to pull blog info */
$current_user = wp_get_current_user();
$user_id = $current_user->id;
$user_blogs = get_blogs_of_user($user_id);
/* Go through the list of blogs and create a list element for each */
foreach ($user_blogs AS $user_blog) {
@Coopeh
Coopeh / query-wpmu-comment-count-for-blog-list.php
Last active October 6, 2015 05:58
Query WPMU Comment Count For A List Of Blogs
<a href="<?php echo $user_blog->siteurl; ?>/wp-admin/edit-comments.php?comment_status=moderated" title="<?php echo $request; ?> Comments awaiting moderation" target="_blank"><?php echo $request ?></a>
@Coopeh
Coopeh / disable-autosave.php
Last active October 6, 2015 05:58
Disable Autosave
function disabler_kill_autosave(){
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disabler_kill_autosave' );
@Coopeh
Coopeh / gist:2947860
Created June 18, 2012 10:54
Stop Skype Restyling Phone Numbers
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE"/>
@Coopeh
Coopeh / gist:2947862
Created June 18, 2012 10:55
Responsive Online Video
<div class="video">
<iframe src="blablabla"></iframe>
</div>