<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>bavotasan.com</title>
	
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Thu, 16 May 2013 14:45:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bavotasan" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="bavotasan" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Magazine Premium 2.0 Preview Video</title>
		<link>http://bavotasan.com/2013/magazine-premium-2-0-preview-video/</link>
		<comments>http://bavotasan.com/2013/magazine-premium-2-0-preview-video/#comments</comments>
		<pubDate>Thu, 16 May 2013 14:45:09 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[magazine premium]]></category>
		<category><![CDATA[premium theme]]></category>
		<category><![CDATA[preview]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4385</guid>
		<description><![CDATA[I put together a little video to show off some of the new features in Magazine Premium 2.0. Expect to see it out next week.]]></description>
				<content:encoded><![CDATA[<p>I put together a little video to show off some of the new features in Magazine Premium 2.0. Expect to see it out next week.</p>
<p><iframe width="680" height="383" src="http://www.youtube.com/embed/LrxZ298e6yY?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/magazine-premium-2-0-preview-video/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Private Site Plugin for WordPress</title>
		<link>http://bavotasan.com/2013/private-site-plugin-for-wordpress/</link>
		<comments>http://bavotasan.com/2013/private-site-plugin-for-wordpress/#comments</comments>
		<pubDate>Wed, 08 May 2013 17:04:10 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[logged in]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[private site]]></category>
		<category><![CDATA[secure site]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4356</guid>
		<description><![CDATA[Sometimes, you may have a site that you want to be viewed by only logged in users. Especially if it&#8217;s some type of internal tool used by a private company&#8230;]]></description>
				<content:encoded><![CDATA[<p>Sometimes, you may have a site that you want to be viewed by only logged in users. Especially if it&#8217;s some type of internal tool used by a private company or group. I recently needed to this on a site I was using to test out some themes, so I thought I would share it in case someone out there needed something similar.</p>
<p>It&#8217;s not a very complicated plugin but it gets the job done.</p>
<p>Here&#8217;s the code:</p>
<pre class="prettyprint" rel="PHP">
&lt;?php
/*
Plugin Name: Private Site
Description: Site is only viewable by logged in users.
Author: c.bavota
Version: 1.0.0
Author URI: http://www.bavotasan.com/
*/
class Bavotasan_Private {
	public function __construct() {
		add_action( 'init', array( $this, 'init' ) );
	}

	public function init() {
		if ( ! is_user_logged_in() &amp;&amp; ! $this-&gt;is_login() ) {
			wp_redirect( admin_url() );
			exit;
		}
	}

	public function is_login() {
    	return in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) );
    }
}
$bavotasan_private = new Bavotasan_Private;
</pre>
<p>You can download it through the link below.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/private-site-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wptuts+: Enhancing the Search Form With typeahead.js</title>
		<link>http://bavotasan.com/2013/wptuts-enhancing-the-search-form-with-typeahead-js/</link>
		<comments>http://bavotasan.com/2013/wptuts-enhancing-the-search-form-with-typeahead-js/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 23:34:14 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[search form]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wptuts+]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4296</guid>
		<description><![CDATA[I&#8217;ve always thought that the WordPress search could use some work, so I started messing around with typeahead.js and figured out how to add the autocomplete script to the default&#8230;]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve always thought that the WordPress search could use some work, so I started messing around with typeahead.js and figured out how to add the autocomplete script to the default WP search form.<br />
<span id="more-4296"></span><br />
I put together a small plugin and this tutorial on Wptuts+:</p>
<p><a href="http://wp.tutsplus.com/tutorials/plugins/enhancing-the-search-form-with-typeahead-js/">Enhancing the Search Form With typeahead.js</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/wptuts-enhancing-the-search-form-with-typeahead-js/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Only Allow Administrators to Access the WordPress Admin Area</title>
		<link>http://bavotasan.com/2013/only-allow-administrators-to-access-the-wordpress-admin-area/</link>
		<comments>http://bavotasan.com/2013/only-allow-administrators-to-access-the-wordpress-admin-area/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 12:34:52 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-admin]]></category>
		<category><![CDATA[wp_redirect()]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4249</guid>
		<description><![CDATA[A while back I wrote a quick tutorial about fixing an issue with the user redirect called &#8220;Redirect After Adding a New User in WordPress&#8221;. In that tutorial, I mentioned&#8230;]]></description>
				<content:encoded><![CDATA[<p>A while back I wrote a quick tutorial about fixing an issue with the user redirect called <a href="http://bit.ly/Ai4Trb">&#8220;Redirect After Adding a New User in WordPress&#8221;</a>. In that tutorial, I mentioned using the <code>wp_redirect()</code> function to get you to the profile page after adding a new user, which would help speed up the process of modifying a user&#8217;s settings.</p>
<p>In this tutorial, I&#8217;m going to use that same function to redirect users away from the WordPress admin area, unless of course they&#8217;re administrators. All you need to do is hook into the <code>admin_init</code> action:</p>
<pre class="prettyprint" rel="PHP">
add_action( 'admin_init', 'redirect_non_admin_users' );
/**
 * Redirect non-admin users to home page
 *
 * This function is attached to the 'admin_init' action hook.
 */
function redirect_non_admin_users() {
	if ( ! current_user_can( 'manage_options' ) &amp;&amp; '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) {
		wp_redirect( home_url() );
		exit;
	}
}
</pre>
<p>The conditional to check if a user isn&#8217;t an admin first sees if they can manage options (<a href="http://codex.wordpress.org/Roles_and_Capabilities">see WordPress Roles and Capabilities</a>) then it makes sure that the call isn&#8217;t trying to access the Ajax file to actually perform an Ajax call. If both are true, it redirects the user to the home page using the <code>home_url()</code> function.</p>
<p>Placing the above code in your theme&#8217;s <code>functions.php</code> file will add the ability to redirect non-admin users away from your WordPress admin and keep that area safe from those who might wish to do some mischief.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/only-allow-administrators-to-access-the-wordpress-admin-area/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Wptuts+: Creating Client Testimonials With Custom Post Types</title>
		<link>http://bavotasan.com/2013/wptuts-creating-client-testimonials-with-custom-post-types/</link>
		<comments>http://bavotasan.com/2013/wptuts-creating-client-testimonials-with-custom-post-types/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 12:50:13 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[testimonials]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wptuts+]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4251</guid>
		<description><![CDATA[When I was putting together the new redesign for Themes by bavotasan.com, I decided to write in some functionality for client testimonials. Which in turn inspired my latest article on&#8230;]]></description>
				<content:encoded><![CDATA[<p>When I was putting together the new redesign for <a href="http://themes.bavotasan.com">Themes by bavotasan.com</a>, I decided to write in some functionality for client testimonials. Which in turn inspired my latest article on Wptuts+.</p>
<p>Check it out: <a href="http://wp.tutsplus.com/tutorials/plugins/creating-client-testimonials-with-custom-post-types/">Creating Client Testimonials With Custom Post Types</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/wptuts-creating-client-testimonials-with-custom-post-types/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tango Premium WordPress Theme</title>
		<link>http://bavotasan.com/2013/tango-premium-wordpress-theme/</link>
		<comments>http://bavotasan.com/2013/tango-premium-wordpress-theme/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 13:09:41 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[business theme]]></category>
		<category><![CDATA[premium theme]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4220</guid>
		<description><![CDATA[Just released a great new Premium Theme called Tango. It has tons of great features, including a wicked CSS3 slider. Here&#8217;s a quick look: Check out the demo.]]></description>
				<content:encoded><![CDATA[<p>Just released a great new Premium Theme called Tango. It has tons of great features, including a wicked CSS3 slider.<span id="more-4220"></span> Here&#8217;s a quick look:</p>
<p><img src="http://cdn.bavotasan.com/wp-content/uploads/2013/02/tango-big.jpg" alt="tango-big" width="550" height="632" class="alignnone size-full wp-image-4221" /></p>
<p><a href="http://demos.bavotasan.com/tango/">Check out the demo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/tango-premium-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Removing Comments from Attachment Pages in WordPress</title>
		<link>http://bavotasan.com/2013/removing-comments-from-attachment-pages-in-wordpress/</link>
		<comments>http://bavotasan.com/2013/removing-comments-from-attachment-pages-in-wordpress/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 17:25:15 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[add_action()]]></category>
		<category><![CDATA[add_filter()]]></category>
		<category><![CDATA[attachment.php]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4204</guid>
		<description><![CDATA[I&#8217;m not too sure what&#8217;s been happening over the past week but all of a sudden I&#8217;ve been getting tons of spam comments from my attachment pages. I didn&#8217;t actually&#8230;]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m not too sure what&#8217;s been happening over the past week but all of a sudden I&#8217;ve been getting tons of spam comments from my attachment pages. I didn&#8217;t actually know I had attachment pages but I guess WordPress creates them by default within the template hierarchy. Problem is, there&#8217;s no way to turn off the comment section. Though I did figure out a few ways to work around that.</p>
<p>If you don&#8217;t mind creating a new file, create one named <code>attachment.php</code> and add it to your theme&#8217;s folder. You should be able to just copy over the <code>single.php</code> file. Just be sure to remove the function that displays the comment form.</p>
<p>It should end up looking something like this:</p>
<pre class="prettyprint" rel="PHP">
&lt;?php get_header(); ?&gt;

	&lt;div id=&quot;primary&quot; &lt;?php gridiculous_primary_attr(); ?&gt;&gt;

		&lt;?php
		while ( have_posts() ) : the_post();
			get_template_part( 'content', 'page' );
		endwhile; // end of the loop.
		?&gt;

	&lt;/div&gt;&lt;!-- #primary.c8 --&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>That&#8217;s an example of how the Attachment page template would look in Gridiculous Pro. By creating a new page template, you allow yourself the option to customize it however you like, so that might be the right solution for you.</p>
<p>If you&#8217;d rather just turn off the comment section without having to create a new file, there are two approaches. </p>
<p>The easiest would be to just open up your <code>single.php</code> and look for the <code><?php comments_template( '', true ); ?></code> function. Once you find it, just replace it with this:</p>
<pre class="prettyprint" rel="PHP">
&lt;?php
if ( 'attachment' != get_post_type( get_the_ID() ) )
     comments_template( '', true );
?&gt;
</pre>
<p>Or you could use one of the WordPress action hooks to remove the comment section programmatically. This can be done by adding the following to your <code>functions.php</code> file:</p>
<pre class="prettyprint" rel="PHP">
add_action( 'pre_comment_on_post', 'remove_comments_from_attachments', 10, 2 );
/**
 * Function to remove the comment section from all attachment pages
 * 
 * @param  $open
 * @param  $post_id
 */
function remove_comments_from_attachments( $open, $post_id ){
    return ( 'attachment' == get_post_type( $post_id )  ) ? false : $open;
}
</pre>
<p>Whichever way you choose to remove comments from your attachment pages is up to you, though it should be something you look into if you start to see the number of spam comments coming in increase.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/removing-comments-from-attachment-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Wptuts+: Adding a Custom CSS Editor to Your Theme Using ACE</title>
		<link>http://bavotasan.com/2013/wptuts-adding-a-custom-css-editor-to-your-theme-using-ace/</link>
		<comments>http://bavotasan.com/2013/wptuts-adding-a-custom-css-editor-to-your-theme-using-ace/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 12:14:28 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[ace editor]]></category>
		<category><![CDATA[custom css]]></category>
		<category><![CDATA[theme development]]></category>
		<category><![CDATA[wptuts+]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4190</guid>
		<description><![CDATA[Got another article up on Wptuts+ about adding a Custom CSS editor your theme using a great online editing tool called ACE. Check it out: http://wp.tutsplus.com/tutorials/theme-development/adding-a-custom-css-editor-to-your-theme-using-ace/]]></description>
				<content:encoded><![CDATA[<p>Got another article up on Wptuts+ about adding a Custom CSS editor your theme using a great online editing tool called ACE.<br />
<span id="more-4190"></span><br />
Check it out: <a href="http://wp.tutsplus.com/tutorials/theme-development/adding-a-custom-css-editor-to-your-theme-using-ace/">http://wp.tutsplus.com/tutorials/theme-development/adding-a-custom-css-editor-to-your-theme-using-ace/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/wptuts-adding-a-custom-css-editor-to-your-theme-using-ace/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Prevent Default Behaviour of Hashed Anchor Tag with jQuery</title>
		<link>http://bavotasan.com/2013/prevent-default-behaviour-of-hashed-anchor-tag-with-jquery/</link>
		<comments>http://bavotasan.com/2013/prevent-default-behaviour-of-hashed-anchor-tag-with-jquery/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 12:27:09 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[anchor tags]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4179</guid>
		<description><![CDATA[Way back in the day, I use to always set up my event triggering anchor tags a certain way to prevent their default behaviour of having to click-through to a&#8230;]]></description>
				<content:encoded><![CDATA[<p>Way back in the day, I use to always set up my event triggering anchor tags a certain way to prevent their default behaviour of having to click-through to a URL or named anchor:</p>
<pre class="prettyprint" rel="HTML">
&lt;a href=&quot;javascript:void(0)&quot; class=&quot;trigger&quot;&gt;Trigger&lt;/a&gt;
</pre>
<p>Usually, a more simple approach was to use a simple hash:</p>
<pre class="prettyprint" rel="HTML">
&lt;a href=&quot;#&quot; class=&quot;trigger&quot;&gt;Trigger&lt;/a&gt;
</pre>
<p>That&#8217;s the way I should&#8217;ve been doing it, but I really hated how it always made the browser window jump to the top.</p>
<p>Solving that wasn&#8217;t too complicated. It just took a bit of jQuery.</p>
<pre class="prettyprint lang-javascript" rel="JQUERY">
&lt;script type=&quot;text/javascript&quot;&gt;
/* &lt;![CDATA[ */
( function( $ ) {
   $( 'a[href=&quot;#&quot;]' ).click( function(e) {
      e.preventDefault();
   } );
} )( jQuery );
/* ]]&gt; */
&lt;/script&gt;
</pre>
<p>With that code in place, the browser no longer jumps to the top when using a hashed anchor tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/prevent-default-behaviour-of-hashed-anchor-tag-with-jquery/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Working with Custom Admin Pointers in WordPress</title>
		<link>http://bavotasan.com/2013/working-with-custom-admin-pointers-in-wordpress/</link>
		<comments>http://bavotasan.com/2013/working-with-custom-admin-pointers-in-wordpress/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 14:28:43 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[admin pointers]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tooltips]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=4139</guid>
		<description><![CDATA[When WordPress 3.3 was released we were introduced to the new Admin Pointers, those blue and white boxes that had tips on how to use some of the new features.&#8230;]]></description>
				<content:encoded><![CDATA[<p>When WordPress 3.3 was released we were introduced to the new Admin Pointers, those blue and white boxes that had tips on how to use some of the new features. Seeing how WP used them to help guide users through some of the new features was brilliant.<br />
So why not try to take advantage of the Admin Pointers when developing your own themes and plugins?</p>
<p><img src="http://cdn.bavotasan.com/wp-content/uploads/2013/01/pointer2.jpg" alt="pointer2" width="328" height="168" class="alignnone size-full wp-image-4143" /></p>
<p>There is no real API as of yet, but hooking into the JS files and creating some helper functions isn&#8217;t that difficult. All it takes is a few functions to add some custom Admin Pointers.</p>
<p>First thing we need to do is enqueue the JS and CSS files:</p>
<pre class="prettyprint lang-php" rel="php">
add_action( 'admin_enqueue_scripts', 'custom_admin_pointers_header' );

function custom_admin_pointers_header() {
   if ( custom_admin_pointers_check() ) {
      add_action( 'admin_print_footer_scripts', 'custom_admin_pointers_footer' );

      wp_enqueue_script( 'wp-pointer' );
      wp_enqueue_style( 'wp-pointer' );
   }
}
</pre>
<p>We also need a couple of helper functions to make sure things work the way they should. The first is the conditional check:</p>
<pre class="prettyprint lang-php" rel="php">
function custom_admin_pointers_check() {
   $admin_pointers = custom_admin_pointers();
   foreach ( $admin_pointers as $pointer =&gt; $array ) {
      if ( $array['active'] )
         return true;
   }
}
</pre>
<p>Next comes the footer script:</p>
<pre class="prettyprint lang-php" rel="php">
function custom_admin_pointers_footer() {
   $admin_pointers = custom_admin_pointers();
   ?&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/* &lt;![CDATA[ */
( function($) {
   &lt;?php
   foreach ( $admin_pointers as $pointer =&gt; $array ) {
      if ( $array['active'] ) {
         ?&gt;
         $( '&lt;?php echo $array['anchor_id']; ?&gt;' ).pointer( {
            content: '&lt;?php echo $array['content']; ?&gt;',
            position: {
            edge: '&lt;?php echo $array['edge']; ?&gt;',
            align: '&lt;?php echo $array['align']; ?&gt;'
         },
            close: function() {
               $.post( ajaxurl, {
                  pointer: '&lt;?php echo $pointer; ?&gt;',
                  action: 'dismiss-wp-pointer'
               } );
            }
         } ).pointer( 'open' );
         &lt;?php
      }
   }
   ?&gt;
} )(jQuery);
/* ]]&gt; */
&lt;/script&gt;
   &lt;?php
}
</pre>
<p>With all of that in place, the basic functionality for our custom admin pointers is ready. Now we just need to put together the actual array so that we can set up where we want out pointers to appear and what we want them to say.</p>
<p>Here is an example of a custom admin pointer that will appear below the &#8220;+ New&#8221; item in the admin bar menu:</p>
<pre class="prettyprint lang-php" rel="php">
function custom_admin_pointers() {
   $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
   $version = '1_0'; // replace all periods in 1.0 with an underscore
   $prefix = 'custom_admin_pointers' . $version . '_';

   $new_pointer_content = '&lt;h3&gt;' . __( 'Add New Item' ) . '&lt;/h3&gt;';
   $new_pointer_content .= '&lt;p&gt;' . __( 'Easily add a new post, media item, link, page or user by selecting from this drop down menu.' ) . '&lt;/p&gt;';

   return array(
      $prefix . 'new_items' =&gt; array(
         'content' =&gt; $new_pointer_content,
         'anchor_id' =&gt; '#wp-admin-bar-new-content',
         'edge' =&gt; 'top',
         'align' =&gt; 'left',
         'active' =&gt; ( ! in_array( $prefix . 'new_items', $dismissed ) )
      ),
   );
}
</pre>
<p>This snippet needs  a bit of explaining so let&#8217;s break down the items:</p>
<pre class="prettyprint lang-php" rel="php">
/**
 * This is the version number of your theme/plugin. It needs to be updated each time you
 * update your theme/plugin or else the admin pointers will not re-appear.
 */
$version = '1_0'; // replace all periods in 1.0 with an underscore
</pre>
<pre class="prettyprint lang-php" rel="php">
/**
 * This is the title and content that you want to appear in the admin pointer. Do not change
 * the HTML tags, only modify the text within the single quotes.
 */
$new_pointer_content = '&lt;h3&gt;' . __( 'Add New Item' ) . '&lt;/h3&gt;';
$new_pointer_content .= '&lt;p&gt;' . __( 'Easily add a new post, media item, link, page or user by selecting from this drop down menu.' ) . '&lt;/p&gt;';
</pre>
<p>The return array needs to be broken down even more:</p>
<pre class="prettyprint lang-php" rel="php">
/**
 * This is the actual array that will contain the elements needed to display your custom
 * admin pointers.
 */
// Make sure the 'new_items' string is unique to each new array item
$prefix . 'new_items' =&gt; array(

   // The content needs to point to what we created above in the $new_pointer_content variable 
   'content' =&gt; $new_pointer_content,
   
   // In order for the custom pointer to appear in the right location we need to specify the ID
   // of the element we want it to appear next to
   'anchor_id' =&gt; '#wp-admin-bar-new-content',

   // On what edge do we want the pointer to appear. Options are 'top', 'left', 'right', 'bottom'
   'edge' =&gt; 'top',

   // How do we want out custom pointer to align to the element it is attached to. Options are
   // 'left', 'right', 'center'
   'align' =&gt; 'left',

   // This is how we tell the pointer to be dismissed or not. Make sure that the 'new_items'
   // string matches the string at the beginning of the array item
   'active' =&gt; ( ! in_array( $prefix . 'new_items', $dismissed ) )
),
</pre>
<p>With all of this in place, our new code should look something like this:</p>
<pre class="prettyprint" rel="php">
add_action( 'admin_enqueue_scripts', 'custom_admin_pointers_header' );

function custom_admin_pointers_header() {
   if ( custom_admin_pointers_check() ) {
      add_action( 'admin_print_footer_scripts', 'custom_admin_pointers_footer' );

      wp_enqueue_script( 'wp-pointer' );
      wp_enqueue_style( 'wp-pointer' );
   }
}

function custom_admin_pointers_check() {
   $admin_pointers = custom_admin_pointers();
   foreach ( $admin_pointers as $pointer =&gt; $array ) {
      if ( $array['active'] )
         return true;
   }
}

function custom_admin_pointers_footer() {
   $admin_pointers = custom_admin_pointers();
   ?&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/* &lt;![CDATA[ */
( function($) {
   &lt;?php
   foreach ( $admin_pointers as $pointer =&gt; $array ) {
      if ( $array['active'] ) {
         ?&gt;
         $( '&lt;?php echo $array['anchor_id']; ?&gt;' ).pointer( {
            content: '&lt;?php echo $array['content']; ?&gt;',
            position: {
            edge: '&lt;?php echo $array['edge']; ?&gt;',
            align: '&lt;?php echo $array['align']; ?&gt;'
         },
            close: function() {
               $.post( ajaxurl, {
                  pointer: '&lt;?php echo $pointer; ?&gt;',
                  action: 'dismiss-wp-pointer'
               } );
            }
         } ).pointer( 'open' );
         &lt;?php
      }
   }
   ?&gt;
} )(jQuery);
/* ]]&gt; */
&lt;/script&gt;
   &lt;?php
}

function custom_admin_pointers() {
   $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
   $version = '1_0'; // replace all periods in 1.0 with an underscore
   $prefix = 'custom_admin_pointers' . $version . '_';

   $new_pointer_content = '&lt;h3&gt;' . __( 'Add New Item' ) . '&lt;/h3&gt;';
   $new_pointer_content .= '&lt;p&gt;' . __( 'Easily add a new post, media item, link, page or user by selecting from this drop down menu.' ) . '&lt;/p&gt;';

   return array(
      $prefix . 'new_items' =&gt; array(
         'content' =&gt; $new_pointer_content,
         'anchor_id' =&gt; '#wp-admin-bar-new-content',
         'edge' =&gt; 'top',
         'align' =&gt; 'left',
         'active' =&gt; ( ! in_array( $prefix . 'new_items', $dismissed ) )
      ),
   );
}
</pre>
<p>With this added to your theme&#8217;s functions.php file or your plugin&#8217;s main init file you now have the ability to add custom admin pointers to any element that you want your user to notice. You can add more items to the final array to create as many custom admin pointers as you heart desires&#8230; or your theme/plugin requires.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2013/working-with-custom-admin-pointers-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.135 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-19 15:03:22 --><!-- Compression = gzip -->
