Skip to content

Instantly share code, notes, and snippets.

@r-a-y
r-a-y / bbp-site-public-hotfix.php
Created February 4, 2014 19:45
Fix bbPress' bbp_is_site_public() function.
<?php
/*
Plugin Name: bbPress - Fix Site Public function
Description: Hotfix for bbPress' bbp_is_site_public() function.
Version: 0.1
Author: r-a-y
Author URI: http://profiles.wordpress.org/r-a-y
*/
/**
@r-a-y
r-a-y / ray-disable-mail.php
Created February 13, 2014 00:12
Disables all email from being sent on a WordPress install.
<?php
/*
Plugin Name: Disable Email
Description: Disables all email from being sent.
Author: r-a-y
Version: 0.1
*/
if( ! function_exists( 'wp_mail' ) ) :
function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {
@r-a-y
r-a-y / disable-email-on-sitewide-tags.php
Last active August 29, 2015 13:56
Disables email from sending on a WPMU Sitewide Tags blog.
<?php
/*
Plugin Name: WPMU Sitewide Tags - Disable Email
Description: Disables email from sending on a WPMU Sitewide Tags blog.
Author: r-a-y
Version: 0.1
*/
/**
* Disables emails from firing on the WPMU Sitewide Tags blog.
@r-a-y
r-a-y / hwdsb-hidesites.php
Created May 26, 2014 17:35
Removes the main site and the current blog from the adminbar for those that do not have publishing rights in WordPress.
<?php
/*
Plugin Name: HWDSB Remove Sites From Adminbar.
Description: Removes the main site and the current blog from the adminbar for those that do not have publishing rights.
Version: 0.1
Author: r-a-y
Author URI: http://profiles.wordpress.org/r-a-y
*/
class HWDSB_Remove_Sites_Adminbar {
@r-a-y
r-a-y / ray-bp-all-blog-posts.php
Created June 12, 2014 02:19
BuddyPress - Merge both blog posts and BP Groupblog posts together when using the "Recent Networkwide Posts" widget.
/**
* Merges both blog posts and groupblog posts together when using the "Recent
* Networkwide Posts" widget supplied by BuddyPress.
*/
function ray_merge_blog_posts_and_groupblog_posts( $retval ) {
// check the Recent Networkwide Posts activity args
// make sure they all match
if ( 'new_blog_post' === $retval['action'] &&
0 == $retval['user_id'] &&
false == $retval['scope'] &&
@r-a-y
r-a-y / ray.php
Created March 31, 2015 16:51
Debug log function for WordPress. Put this in /wp-content/mu-plugins/.
<?php
function ray_log( $message ) {
if ( empty( $message ) )
return;
error_log( '[' . gmdate( 'd-M-Y H:i:s' ) . '] ' . $message . "\n", 3, WP_CONTENT_DIR . '/ray.log' );
}
@r-a-y
r-a-y / cbox-distro
Last active August 29, 2015 14:21
CBOX wp.org distro bash script
#!/bin/bash
# CBOX wp.org distro script
#
# Before using:
# 1. Ensure that 1.0.x branch has pinned all plugins to latest version.
# 2. Checkout a new branch for wp.org. @todo decide on a branch name.
# 3. Create the following folder - 'includes/zip'
#
# Next, run this bash script.
@r-a-y
r-a-y / gist:4145322
Created November 25, 2012 21:03
BuddyPress - Remove group activity post form
/**
* Remove the group activity post form
*/
add_action( 'bp_before_group_activity_post_form', create_function( '', 'ob_start();' ), 9999 );
add_action( 'bp_after_group_activity_post_form', create_function( '', 'ob_end_clean();' ), 0 );
@r-a-y
r-a-y / bp17-compat.php
Last active December 14, 2015 16:59
Add BP 1.7 theme loading functions to your BP plugin. This is so you can use awesome functions like bp_get_template_part() and bp_locate_template(). Before including this file, do a check to see if v1.7 exists. You could do this with: if ( ! class_exists( 'BP_Theme_Compat' ) ) require( 'THIS GIST!' );
<?php
/**
* Backwards compatibililty functions for < BP 1.7.
*
* @author r-a-y
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
@r-a-y
r-a-y / todo.md
Last active January 26, 2016 20:54
Stuff I want to work on
  • BP OStatus - Support OStatus for BuddyPress. Decentralization FTW! Will require a lot of integration (PubSubHubbub, ActivityStreams, Salmon, Portable Contacts, and Webfinger). See OStatus W3C draft spec for more info.
  • BP Mobile Theme - A mobile-optimized BuddyPress theme or template pack
  • BP History API - Fool around with HTML5's History API with BuddyPress - https://github.com/r-a-y/bp-pushstate
  • WP Community Blog - A lightweight blog for members based on a custom post type. Would not use multisite.
  • BP Webmentions - BP plugin supporting the Webmention API - http://webmention.org
  • WP Stream - A WP plugin supporting Stream - http://getstream.io; this would be an alternative to BuddyPress.