Monthly Archives: August 2010
Users / Roles / Capabilities
I presented on August 30, 2010 to the DC WordPress group on the topic of the Users / Roles / Capabilities system in WordPress. I presented a small number of slides, and wrote four simple plugins to demonstrate some specific features. My slides (In HTML / CSS / JS, not some proprietary format) are available at http://aaron.jorb.in/slides/dcwp0810/. You can navigate through them with your arrow keys, or you press esc and it will take you to thumbnails where you can jump around.
I’ve also posted each of the plugins I wrote, along with a detailed explanation of them.
Shortcodes for Discrimination – Provides shortcodes that allow either users or non users to see certain content
Personalize Read More – Changes the Read More link to call out logged in users by name
Add Role – This adds a role for managing links and removes editors ability to
Replacing Jabber, AIM, and Yahoo messenger with twitter on profile Pages
Repository containing all the code: http://code.google.com/p/wp-user-plugins/
Happy Coding.
Adding a twitter box to the Profile page in WordPress
I haven’t used AIM in years and I haven’t used Yahoo Messager in even longer. What I do use is twitter. Therefore, having a box in the WordPress admin for twitter name is better and with some code I wrote for the , super easy.
add_filter('user_contactmethods', 'jorbin_user_contactmethods');
/**
* Removes AIM, YAHOO, and Jabber boxes from profile page and adds Twitter in it's place
*
*/
function jorbin_user_contactmethods($user_contactmethods){
$new_user_contactmethods['twitter'] = __('Twitter');
return $new_user_contactmethods;
}
Filtering user_contactmethods is one of the easiest things you can do. All you need to do is return an array where the key is the code based name you want and the value is the public facing name. Easy. As. Pie.
Add Role
This simple plugin, built for my WordPress DC Presentation on the Users API adds a role called link master, that gets the capability to edit links and also read private posts and pages and also removes the ability for editors to manage categories.
Personalized Read More
Want to make the read more link in WordPress call out the user if they are logged in? As part of my DC WordPress presentation, i showed that it’s easy as pie and only about 10 lines of code.
WordPress Shortcodes for Users and Non Users
One of the plugins I wrote for the DC WordPress group’s meeting on Users / Roles / Capabilities demonstrates how to create shortcode that makes some content only visable by users with a certain capability and other content only visable to non logged in viewers. You can download Shortcodes for Discrimination (along with the other three ) from google code. Beyond the jump, I go over the code and an explanation of how it works.
Tweets from the week before 2010-08-30
- @KatherineKMH YES YES YES! Do you deliver? in reply to KatherineKMH #
- @KatherineKMH You are Awesome! Thank you, Thank you, Thank you. in reply to KatherineKMH #
- 33 Chilean Miners are trapped inside a collapsed mine. It will take four months to rescue them. Future made for TV movie? http://jorb.in/t #
- @twittgrinder What kind of problems are you having with Thirty Ten? Anything I can help with? in reply to twittgrinder #
- @twittgrinder Glad you like! I'm going to be fixing some bugs and releasing a new version shortly. in reply to twittgrinder #
- Slowly, but surely I'm finding more and more uses for definition lists in HTML. What's your favorite underused element? #
- Do to some contract problems, I need a new job soon. If anyone know of a Web Dev or Engineer position, let me know. #jobs #dc #
- @JohnPBloch haha, no. It's because of some RFP language in the recompete. You coming to the PHP beverage subgroup tonight? in reply to JohnPBloch #
- @nacin Are you going to the #dcphp beverage subgroup tonight? in reply to nacin #
- @kmcdade Thanks. I'm rolling with the punches and think that everything is going to work out. in reply to kmcdade #
- @JohnPBloch Every time you nest a ternary, you need to write three times the documentation. Do you really like documentation that much? in reply to JohnPBloch #
- Chapters and Sections for the WordPress Plugin Developer Handbook: http://jorb.in/u #
- @xentek While happiness level can be directly influenced by bacon, lack of Bacon does not make one unhappy. in reply to xentek #
- OH NO! Due to the last tweet by @xentek, I realized that it has been over a month since I had Bacon. Must Solve this soon. #
- @xentek It's not that I'm not happy, quite the opposite in fact. I just hate when I accidentally forget to eat Bacon. in reply to xentek #
- @xentek Double Bacon? That is double plus good in reply to xentek #
- I just updated ThirtyTen, a TwentyTen child theme: http://aaron.jorb.in/thirtyten/2010/08/25/version-1-1-4/ #
- @sivel Stay strong. You are one of the people that make me proud to say I'm a part of the WordPress community in reply to sivel #
- @sarahnaeger Don't act like you're not excited to take a stats course. in reply to sarahnaeger #
- I am in 100% agreement RT @xentek: I love OpenID more, each time I use it #
- @bgardner I assume leaving out the capital P was an attempt at proving the point? in reply to bgardner #
- @KatherineKMH Honesty is being nice. Lies are mean. in reply to KatherineKMH #
- @xentek Don't forgot, it also matters what is inside the <head> in reply to xentek #
- Interested in WordPress Users, Roles, and Capabilities? I'm speaking on them Monday @ 7pm @ MLK Library http://jorb.in/v #
- if ($current_user->display_name == 'looks' && current_user_can('kill') ) #DeveloperMovies #
- @ctumaven How did Delta fuck up and screw you? in reply to ctumaven #
- $person = new musician(); $person->instrument = 'fiddle'; $person->location = 'roof'; #DeveloperMovies #
- $this->film = 'not yet rated'; #DeveloperMovies #
- while ($you == 'sleeping) #DeveloperMovies #
- @JohnPBloch DOH! in reply to JohnPBloch #
- Fix syntax error. Props @JohnPBloch RT @aaronjorbin: while ($you == 'sleeping') #DeveloperMovies #
- die('Another day'); #DeveloperMovies #
- @jfc3 It's been 22 days since I went there, so I'm in if you go in reply to jfc3 #
- @chrishalebarnes Of Course
in reply to chrishalebarnes # - Ray's Hell Burger with @jfc3 and @nacin tonight. Great burger, great conversations. #100meat #
- @JohnPBloch I'll have more information hopefully this week for you. There are still logistics that need to be figured out. So the moral is in reply to JohnPBloch #
- @JohnPBloch …Wait to start writing it. in reply to JohnPBloch #
- I'm stealing this and making it my #ff as well RT @Viper007Bond: #ff @levarburton because Reading Rainbow f'ing kicked ass.
# - nor mine RT @nacin: Sure isn't mine. RT @jfc3 had great conversations about PHP, WP, & someone's old version (2.2.3) w/ @aaronjorbin @nacin #
- @vinthomas You can do it. Every file in the plugin directory (and one additional level ) with a plugin header is available to be installed in reply to vinthomas #
- @vinthomas Look at http://wordpress.org/extend/plugins/twitter-tools/ to see an example of multiple plugins in one plugin instillation in reply to vinthomas #
- @vinthomas Place them all in a single folder. Or better yet set up svn and put them all as externels, then you can easily grab them at once in reply to vinthomas #
- @xentek @JohnJamesJacoby @nacin As glad as I am to find random sites that support gravatar, I'm happier when they support OpenID. #

