Skip to content

Instantly share code, notes, and snippets.

View modemlooper's full-sized avatar
🏠
Working from home

modemlooper modemlooper

🏠
Working from home
View GitHub Profile
<?php
/*
*
* place BP customizations in this here
*
*/
define( 'BP_AVATAR_THUMB_WIDTH', 100 );
define( 'BP_AVATAR_THUMB_HEIGHT', 100 );
define( 'BP_AVATAR_FULL_WIDTH', 250 );
function wds_filter_profile_url( $user_id = 0, $user_nicename = false, $user_login = false ) {
//var_dump( $user_nicename ); // this is user id even though it says nicename
// get user login do a str_replace for username?
$username = 'wewewewew';
$after_domain = bp_core_enable_root_profiles() ? $username : bp_get_members_root_slug() . '/' . $username;
jQuery( document ).ajaxComplete( function( evt, xhr, options ) {
var action = get_var_in_query( 'action', options.data ) ;
//switch
switch( action ){
case 'post_update':
console.log('Activity was posted');
@modemlooper
modemlooper / gist:989cdd4ed2349eef0ee0
Created April 3, 2015 15:02
hide edit profile fields - BuddyPress
function bpfr_hide_profile_field_group( $retval ) {
if ( bp_is_active( 'xprofile' ) ) :
// hide profile group/field to all except admin
if ( !is_super_admin() ) {
//exlude fields, separated by comma
$retval['exclude_fields'] = '1';
//exlude field groups, separated by comma
$retval['exclude_groups'] = '1';
}
<?php echo get_fav_or_unfav_button_for_post( $post ); ?>
function get_fav_or_unfav_button_for_post( $post ) {
global $bp, $activities_template;
// user is not logged ? Show nothing.
if ( ! is_user_logged_in() ) {
return '';
}
$activity_id = bp_activity_get_activity_id( array(
add_filter( 'rest_url_prefix', function () { return 'wp-rest'; } );
<?php
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Main Media Class.
*
* @since BuddyPress (1.5.0)
*/
@modemlooper
modemlooper / gist:4806ac62c2df80832abe
Last active August 29, 2015 14:20
BuddyPress filters
//turn off webcam support
add_filter( ‘bp_avatar_use_webcam’, ‘__return_false’ )
// turn off star messages
add_filter( 'bp_messages_is_starred_enabled', '__return_false' );
// add marker for single address
function findAddress(address) {
var geocoder = new google.maps.Geocoder();
var addresses = ( typeof addresses != 'undefined' && x instanceof Array ) ? address.split('|') : address;
for ( var i = 0; i < addresses.length; i++) {
if( map_places ) {
@modemlooper
modemlooper / gist:579a28d8ab98b446fa65
Created June 24, 2015 17:52
Reactor pg plugins for CLI
cordova plugin add org.apache.cordova.device;
cordova plugin add org.apache.cordova.splashscreen;
cordova plugin add org.apache.cordova.inappbrowser;
cordova plugin add org.apache.cordova.dialogs;
cordova plugin add org.apache.cordova.geolocation;
cordova plugin add org.apache.cordova.vibration;
cordova plugin add org.apache.cordova.network-information;
cordova plugin add com.phonegap.plugin.statusbar;
cordova plugin add nl.x-services.plugins.socialsharing;
cordova plugin add com.adobe.plugins.gaplugin;