Why I Love Alfred.app

Despite appearances, this post is not an in-depth review of Alfred.app features. Yes, it covers many, but not all as there are some features I haven’t used to the full yet. Here, I’m covering the assorted features that I use on a regular basis. With how hard Alfred works for me, I really don’t know how I’d ever get by without it.

As of this post (and since Sep 13, 2010) I’ve launched Alfred 17,402 times for an average of 33.0 times per day. But combined with my office computer, it’s closer to 60K launches.

Continue reading Why I Love Alfred.app

Using WordPress and P2 to Manage ALL THE THINGS!!

For the presentation I’m developing (which I may or may not actually give in public), I’m leaning toward discussing what I’ve learned about using WordPress and the P2 theme to coordinate interoffice communication.

“Using WordPress to Manage Clients, Projects, News, KB ALL THE THINGS!!”

  • Why?
    Needed a system to reduce clogged inboxes, avoid long hard-to-follow email threads, keep the conversations open so info can be found again, even by those not originally involved in the conversation.
  • The Setup
    Private team/dept blogs for discussion that would be irrelevant elsewhere. Multiple topical “public” (still private to the company) blogs (e.g. Company News, Ideas, Wiki, etc.). And CRM style functionality: managing clients and projects, which can be linked together.
  • The Plugins
    Some from P2 functions.php, and cover the custom plugins (@mention notifications, Facebook-esque “liking”, post subscriptions, cross-site post linking, etc.
  • “The Future”
    squash bugs, streamline the code, and maybe/hopefully release it

Of course, I still need to flesh things out, but I also need your help. I’d like to let the audience ask questions, but I don’t want to be caught completely off guard. Can you help me anticipate what questions might come up? From the obvious to the obscure, let me know what you might ask so I can better prepare.

WordPress Talk Ideas

Supposing I were to take the time to write up a talk on some WordPress subject (probably development related), and then supposing I were to actually give this talk in front of a group of people, what do you think it should be about?

I’m considering being prepared with a talk proposal for an upcoming WordCamp – but I need help with brainstorming. Please, please, please offer a recommendation in the comments, or hit me up on Twitter.

I can’t promise that I’ll actually end up giving a presentation – whether out of failure to submit a proposal or out of failure to bribe someone to accept mine – but I will choose a topic and make every effort to prepare a talk/tutorial/presentation and share it here on trepmal.com.

My Favorite WordPress Resources

Really. There are a lot of WordPress resources out there, with fancy tutorials and snippets and thingamajigs, but 99% of my questions are answered in one of the above 2 sites.

Once I’ve got  piece of code working the way I want, I save it so I can refer to it later. I’m working on consolidating all my working code snippets, but for now they can be found on this site, or in github gists (as well as in some of my plugins). Some are still in the mu-plugins folder of my local development site, I’m working on getting those cleaned up and online.

The reason for all the photos

Some have wondered why I have been posting more photos than code recently. Firstly, I haven’t been posting less code, I’ve just been filling the gaps between posts.

As an avid fan of WordPress, it was silly of me to use the software so infrequently. Building plugins is great fun, but it’s even better when you have a better understanding of what the software can actually do.

My recent dive into photo blogging isn’t so much about the photos (although it is a hobby), it’s about getting more familiar with WordPress. The more I use it, the more I know about it. And thus the more helpful my plugins can be. So I’ve been making an effort to post everyday, even if just a quick photo.

Overtime, as I build this habit, you’ll start seeing quotes, links, or short response posts like this one in addition to the geekier posts I’ve been posting for the past couple years.

Disable WYSIWYG Editor For Custom Post Types

If you need to make sure that your custom post type doesn’t have the ‘visual’ tab, you can easily diable it. Suppose you have a custom post type named ‘movie’:

add_filter( 'user_can_richedit', 'disable_for_cpt' );
function disable_for_cpt( $default ) {
	global $post;
	if ( 'movie' == get_post_type( $post ) )
		return false;
	return $default;
}

Add Font-Select Drop Down to Visual Editor

Add the font-select menu to the 2nd row of buttons (revealed with the Kitchen Sink button)

If some items aren’t removed from the second row, the buttons won’t fit nicely on a 1024×768 screen.

See WordPress’s default buttons in wp_tiny_mce()

add_filter('mce_buttons_2', 'add_fontselect_row_2' );

function add_fontselect_row_2( $mce_buttons ) {
    /*
        find the keys of the buttons to be sacrificed
    */
    $pastetext = array_search( 'pastetext', $mce_buttons );
    $pasteword = array_search( 'pasteword', $mce_buttons );
    $removeformat = array_search( 'removeformat', $mce_buttons );

    unset( $mce_buttons[ $pastetext ] );
    unset( $mce_buttons[ $pasteword ] );
    unset( $mce_buttons[ $removeformat ] );

    /*
        insert the new dropdown where the sacrificed buttons used to be
        alter as needed
    */
    array_splice( $mce_buttons, $pastetext, 0, 'fontselect' );
    return $mce_buttons;
}

But if you’re adding the 3rd row, you’re probably clear (unless you have other plugins that are adding buttons).

add_filter('mce_buttons_3', 'add_fontselect_row_3' );

function add_fontselect_row_3( $mce_buttons ) {
    $mce_buttons[] = 'fontselect';
    return $mce_buttons;
}

Currently, any buttons added to the 3rd or 4th rows will always be visible (Kitchen Sink only shows/hides the 2nd row) – but a patch has been submitted to correct this, hopefully it’ll be committed.

However, if you’ll probably want to clean up the font options – remove fonts that you’ll never use (or should never be used).

add_filter('tiny_mce_before_init', 'restrict_font_choices' );
function restrict_font_choices( $initArray ) {
    $initArray['theme_advanced_fonts'] = 
        'Andale Mono=andale mono,times;'.
        'Arial=arial,helvetica,sans-serif;'.
        //'Arial Black=arial black,avant garde;'.
        'Book Antiqua=book antiqua,palatino;'.
        //'Comic Sans MS=comic sans ms,sans-serif;'.
        'Courier New=courier new,courier;'.
        'Georgia=georgia,palatino;'.
        'Helvetica=helvetica;'.
        //'Impact=impact,chicago;'.
        //'Symbol=symbol;'.
        'Tahoma=tahoma,arial,helvetica,sans-serif;'.
        'Terminal=terminal,monaco;'.
        'Times New Roman=times new roman,times;'.
        'Trebuchet MS=trebuchet ms,geneva;'.
        'Verdana=verdana,geneva;'.
        //'Webdings=webdings;'.
        //'Wingdings=wingdings,zapf dingbats'.
        '';
    return $initArray;
}