<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jefferson&#039;s Newspaper &#187; buddypress</title>
	<atom:link href="http://jeffersonsnewspaper.org/tags/buddypress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeffersonsnewspaper.org</link>
	<description>A blog about information, education, and the (digital) humanities...</description>
	<lastBuildDate>Tue, 01 May 2012 12:38:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Tips for Using the WordPress Admin Bar with BuddyPress</title>
		<link>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/</link>
		<comments>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:47:18 +0000</pubDate>
		<dc:creator>E. Bell</dc:creator>
				<category><![CDATA[Reference]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress network]]></category>
		<category><![CDATA[wpmu]]></category>

		<guid isPermaLink="false">http://jeffersonsnewspaper.org/?p=1227</guid>
		<description><![CDATA[If you run a WordPress Network that uses BuddyPress, you are probably aware of the distinctions between the WordPress and BuddyPress admin bars (or in the latter case, the &#8220;buddy bar&#8221;), so we can jump right to the point: You are no longer using the buddy bar, and are now using the core admin bar; there is something you don&#8217;t like about this arrangement and you need to change it. Well, here are a few...]]></description>
			<content:encoded><![CDATA[<p><img src="http://jeffersonsnewspaper.org/wp-content/uploads/2012/01/helmets.png" alt="" title="Admin Bar vs. Admin Bar"  class="aligncenter size-full wp-image-1245" /><br />
If you run a WordPress Network that uses BuddyPress, you are probably aware of the distinctions between the WordPress and BuddyPress admin bars (or in the latter case, the &#8220;buddy bar&#8221;), so we can jump right to the point: You are no longer using the buddy bar, and are now using the core admin bar; there is something you don&#8217;t like about this arrangement and you need to change it. Well, here are a few quick tricks.</p>
<p><span id="more-1227"></span></p>
<p>Each of these snippets (with one noted exception) can be added to functions.php of your main blog theme or you can create a simple <a href="http://codex.wordpress.org/Writing_a_Plugin" title="Writing a plugin @ WP Codex">plugin</a>. </p>
<h4>Swap the BuddyBar for the Admin Bar</h4>
<p>If you somehow are still using the buddy bar, try one of the following methods. (You may also need to adjust your CSS slightly to accommodate the differences between the two admin bars.)</p>
<p>Here is the preferred BuddyPress method, which is simply added to wp-config.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
** Add the following to wp-config.php
** Removes BP admin bar and replaces it with the WP admin bar
*/</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> ‘BP_USE_WP_ADMIN_BAR’<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If for some reason you find that the above method does not work, you may try adding the following to functions.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following removes BP admin bar and replaces it with the WP admin bar
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> remove_bp_adminbar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_core_admin_bar'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_core_admin_bar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     show_admin_bar<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'after_setup_theme'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'remove_bp_adminbar'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Remove something from the Admin Bar</h4>
<p>To remove a menu item, you just need to know its HTML div id. This example removes the WordPress logo and menu.  See <a href="http://codex.wordpress.org/Function_Reference/remove_node" title="remove_node @ WP Codex">remove_node()</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following removes the WordPress menu and logo
** wp-admin-bar-wp-logo is the div id in the menu HTML but we just use wp-logo 
** see http://codex.wordpress.org/Function_Reference/remove_node
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_remove_this<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_node</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp-logo'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
     add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_remove_this'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Adding something to the Admin Bar</h4>
<p>Similarly, you can add a new menu item to an existing HTML div id. Here we are adding a link to create a new category within the +New menu.  See <a href="http://codex.wordpress.org/Function_Reference/add_node" title="add_node @ WP Codex">add_node()</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following adds a link item to create a new &quot;Category&quot; within the &quot;+New&quot; menu
** wp-admin-bar-new-content is the div id in the menu HTML but we just use new-content 
** see http://codex.wordpress.org/Function_Reference/add_node
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_add_this<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$newcat</span><span style="color: #339933;">=</span>get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-admin/edit-tags.php?taxonomy=category'</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_node</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
          <span style="color: #0000ff;">'parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'new-content'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Category'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$newcat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_add_this'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Make it Easier for Network Users to Create New Blogs</h4>
<p>The BuddyPress dev team has added Notifications and some other BP-specific features to the admin bar, but the link to &#8220;Create a new site&#8221; is still missing as of v. 1.5.3 (UPDATE: actually, this would be a WP issue, not BP; <a href="http://core.trac.wordpress.org/ticket/19862" title="Ticket 19862 @ WP Trac">track this issue here</a>). If you have a very active community, especially one that routinely creates new sites (e.g. a university course blog network), they will notice this absence. To add another complication, BuddyPress redirects wp-signup.php to the network homepage, meaning the default WordPress Network mode method for creating a new site is broken (UPDATE: <a href="http://buddypress.trac.wordpress.org/ticket/3941" title="Ticket 3941 @ BP Trac">track this issue here</a>). Luckily both of these are easy to fix.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
** The following adds a link to &quot;Create a new site&quot; under &quot;My Sites&quot; menu
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> admin_bar_create_blog_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$create</span><span style="color: #339933;">=</span>get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/blogs/create/'</span><span style="color: #339933;">;</span>
     <span style="color: #000088;">$wp_admin_bar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_node</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
          <span style="color: #0000ff;">'parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'my-sites'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Create a new site'</span><span style="color: #339933;">,</span>
          <span style="color: #0000ff;">'href'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$create</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_before_admin_bar_render'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'admin_bar_create_blog_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
** The following fixes the dashboard link for &quot;Create a new site&quot;
** By default, WordPress sends the user to wp-signup.php to create a site
** But wp-signup.php is redirected to the network homepage by BuddyPress as of 3.1+ and 1.5.3+ respectively
** This just filters that core behavior to use the BuddyPress link instead
*/</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_signup_location'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'bp_blog_creation_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> bp_blog_creation_link<span style="color: #009900;">&#40;</span><span style="color: #000088;">$old</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bp_include'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
     <span style="color: #b1b100;">return</span> get_site_url<span style="color: #009900;">&#40;</span> BP_ROOT_BLOG <span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/blogs/create/'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Feel free to make additional suggestions in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeffersonsnewspaper.org/2012/tips-for-using-the-wordpress-admin-bar-with-buddypress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

