Skip to content

Instantly share code, notes, and snippets.

@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.
@r-a-y
r-a-y / bp-footer-debug.php
Last active November 19, 2022 00:34
A BuddyPress debug plugin that outputs some useful BuddyPress global variables in the footer.
@r-a-y
r-a-y / gist:5578432
Last active July 23, 2020 06:55
Disable BuddyPress' registration and use WP's instead. Paste this in /wp-content/plugins/bp-custom.php.
/**
* Disables BuddyPress' registration process and fallsback to WordPress' one.
*/
function my_disable_bp_registration() {
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' );
remove_action( 'bp_screens', 'bp_core_screen_signup' );
}
add_action( 'bp_loaded', 'my_disable_bp_registration' );
@r-a-y
r-a-y / README.md
Last active December 16, 2017 21:03 — forked from johnpbloch/README.md

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@r-a-y
r-a-y / gist:5209075
Created March 20, 2013 22:20
Lightweight, frontend version of admin-ajax.php for WordPress.
<?php
/**
* Lightweight, frontend version of admin-ajax.php.
*
* Only loads wp-load.php and sets up the headers and AJAX actions.
*/
// Setup 'DOING_AJAX' constant to be compatible with native WP functionality
define( 'DOING_AJAX', true );
@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 / 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 / shortcode.php
Created February 22, 2012 21:01
Check if a shortcode exists in WordPress
<?php
if ( ! function_exists( 'shortcode_exists' ) ) :
/**
* Check if a shortcode is registered in WordPress.
*
* Examples: shortcode_exists( 'caption' ) - will return true.
* shortcode_exists( 'blah' ) - will return false.
*/
function shortcode_exists( $shortcode = false ) {
global $shortcode_tags;