Categories
Code WordPress

BuddyPress: Disable the Public Members Directory

The following code snippet can be used to disable access to the default BuddyPress Members Directory.  Simply add the following code to your theme’s functions.php file.

//Disable members directory
function disable_directory_members() {
 global $bp, $wp_query;
 $bp_is_directory = false;
 bp_core_redirect( $bp_root_domain );
}
add_action( 'bp_core_action_directory_members', 'disable_directory_members', 2 );

Update – 11/17/2011:  As of BuddyPress v1.5 this post this method is deprecated. You can now achieve this same result by unpublishing the ‘Members’ page from the ‘Pages menu in the admin area.

Categories
Code WordPress

BuddyPress: Remove a Sub Item from a Navigation Menu

This example demonstrates how to remove the Notifications item from the BuddyPress Settings default navigation menu. Simply add the code below to your theme’s functions.php file.

<?php
// Remove Settings->Notifications SubMenu
function skw_remove_notifications_subnav(){
global $bp;
if ( $bp->current_component == $bp->settings->slug ) {
bp_core_remove_subnav_item( $bp->settings->slug, 'notifications' );
}
}
add_action( 'wp', 'skw_remove_notifications_subnav', 2 );

Here is a similar example that could be used to remove the System Notices menu from the Messages section.

<?php
// Remove Messages->Notices
function skw_remove_notices_subnav() {
global $bp;
if ( $bp->current_component == $bp->messages->slug ) {
bp_core_remove_subnav_item( $bp->messages->slug, 'notices' );
}
}
add_action( 'wp', 'skw_remove_notices_subnav', 11 );
Categories
News WordPress

Socialisting.com Launches with Style @ Tribeca Grand Hotel

After almost a year of grueling labor, the website created to find apartments, jobs and stuff from your friends and their friends is finally going beta!  500+ members and counting! Read the full story.

“I want it to be like Friendster,” declares Socialisting founder Lawrence Lewitinn, then quickly clarifies: “The early days.” We’re at Socialisting’s launch party. I found out about this party because I spotted it on Facebook and recognized some attendees. I found Lawrence at the party through Peter Gaston, a SPIN editor my girlfriend met through work. Friends of friends! Theme!

The description for Lawrence’s List asks members to concentrate on listing jobs they’re involved with. “This list is effective when it’s my friends or their friends meeting/hiring/moving in with my friends or their friends, not if it turns into another Craigslist where crazies/kooks/stalkers can find/meet/harass/kill/cook each other.”

Aren’t strangers the worst?

-Nick Douglas
BlackBook Magazine

Categories
Code WordPress

WordPress: Create a Plugin to Create Custom Taxonomies

An example plugin that demonstrates how to easily add new Taxonomies to your WordPress blog.


<?php
/*
Plugin Name: Yor Custom Taxonomies
Plugin URI: http://stevenword.wpengine.com//
Description: Adds custom taxonomies for your WordPress blog
Version: 1.0.0
Author: Steven Word
Author URI: http://stevenword.wpengine.com/
*/

function skw_build_taxonomies() {

 //VEHICLES
 $vehicle_args = array(
 'label' => 'Vehicles',
 'hierarchical' => true,
 'query_var' => true,
 'rewrite' => array('slug' => 'vehicles')
 );
 register_taxonomy( 'skw_vehicles', 'post', $vehicle_args );

 //BRANDS
 $brand_args = array(
 'label' => 'Brands',
 'hierarchical' => true,
 'query_var' => true,
 'rewrite' => array('slug' => 'brands')
 );
 register_taxonomy( 'skw_brands', 'post', $brand_args );

}
add_action( 'init', 'skw_build_taxonomies', 0 );
?>

Categories
WordPress WordPress Plugins

New Plugin Release: WP Query Counter

WP Query Counter is designed to aid developers in using the WordPress query functions as efficiently as possible.

The plugin starts a counter when WordPress initializes and displays the number of executed queries in an absolutely positioned div in the lower right-hand corner of your screen.

You can check it out here!