Bypass the WordPress password form by using the_password_form

Last month, I found Kieran Lane’s blog post on bypassing the WordPress password-protected post form while researching how to allow a client to skip the password form via a URL parameter. Kieran’s solution required editing a WordPress core file, and at the time neither of us had found a less brittle way to solve the problem. Fortunately, it is possible to do just this by using WordPress’s the_password_form filter:

function bypass_password_form( $output ) {
  // Check for a hash of the password
  // exactly as in Kieran's example
  if ( $_GET['pwd'] == md5( $post->post_password ) ) {
    return apply_filters(
      'the_content',
      get_page( get_the_ID() )->post_content
    );
  }
  // Or return the output as normal
  return $output;
}
add_filter('the_password_form','bypass_password_form');

They are not well documented, but there is almost always a way to do something in WordPress using filters—it can just take a few weeks of digging to find the right one! If you are managing your own site, modifying the core files may be fine, but I encourage any WordPress contractors or developers to research and share ways they have found to avoid customizing the core. Having this kind of functionality in a plugin or your theme’s functions.php will make for fewer headaches for clients when they need to upgrade ;)

Stepping Into Custom Post Types

My slides for today’s presentation have been uploaded to Slideshare! I will post a link to the video when it is available.

UPDATE 9/11/11: The video of my post types talk is now online! My sincere thanks to Kurt Eng for all the effort WordCamp Boston put into filming these talks.

Custom Post Types at WordCamp 2011

I will be speaking at WordCamp Boston this weekend, giving an introduction to Custom Post Types for intermediate theme designers. If you will be coming to WordCamp this year, I hope you will drop by!

I’ve cross-posted my blurb from the official WordCamp blog:

WordPress 3.0 expanded theme and plugin developer’s abilities to create Custom Post Types, representing data more complex than the average blog post. This functionality firmly establishes WordPress as a viable Content Management System, but it can be difficult to know how to use these new post types effectively in your themes.

Using a recent client project as a case study, this talk is a candid introduction to Custom Post Types for the intermediate theme developer. I will examine how creating your own post types can benefit you while developing a site, while also calling out some drawbacks and “gotchas” I found while designing a site heavily dependent on my own post types and taxonomies. If you have been developing your own themes and are beginning to need your content organized more clearly than categories allow, this talk may be for you!

BostonIndies.com redesign launched!

Boston Indies Logo

Boston Indies is a local game development group, founded by Scott Macmillan as an offshoot of the larger (and more corporate) Boston PostMortem meetup. I’ve been proud to be associated with the Indies group, and was excited when Darren Torpey asked if I would be available to help them with a site design. Managing editor Jonathan Myers has brought in a lot of good content to the site so my design was pitched to take a backseat to the articles themselves, giving just enough structure and consistency to let the content shine. Check out the new, cleaner look of Boston Indies here.

Trapped in a Tiny Tower

This is my tower. There are many like it, but this one is mine.
This is my tower. There are many like it, but this one is mine.

I have spent way too much time this weekend playing tiny tower. It’s not that I didn’t enjoy my holiday—just that, every fleeting moment I could snag between grilling, family events and fireworks, I would dash to my phone to restock my tiny businesses.

As time-wasters go, Tiny Tower has a leg up on the competition. The writing is clever (and delightfully referential), and the pixel art feels fresh in a market over-saturated in nostalgia. The art’s strength is in abstraction of the familiar: an Apple Store, a wood-grilled pizza parlor, and a brewery are all represented, each row no more than about 50 pixels tall. With a nod to its social-game ancestors, Tiny Tower even abstracts Facebook: your ‘bitizens’ will post status updates about their jobs, favorite pop-culture quotes, or speculations on 8-bit existence. Sam Cooper, one of my “Mapple Store” genius bar associates (complete with blue polo—you can customize each character’s outfits) muses, “If we were thinking with portals then we wouldn’t need these elevators!”

Slam Bolt Scrappers to be released next week!

If you’re not familiar with the video game Slam Bolt Scrappers, I strongly suggest you go check it out at Fire Hose Games’ site. I have worked with Fire Hose several times in the past, most recently this winter to design and launch their new website, and they are great folks. More importantly, the game is a lot of fun! It’s a mashup of sorts, combining elements of Super Smash Bro’s, Tetris and several other games—that may sound weird, but it works. I’ve yet to win a match, but this weekend at PAX East I will be challenging ‘Fire Chief’ Eitan Glinert to a rematch from last year’s PAX, where I suffered a crushing defeat!

Slam Bolt Scrappers is a PSN exclusive, and will be released digitally on March 13. Catch them this weekend at the Penny Arcade Expo, PAX East, in Boston to try the game.

Global Game Jam 2011

My first game jam experience was last year’s Global Game Jam, and I’m happy to announce that one year out I did it again! I’ve gone to a number of smaller jams over the past year, and was much more confidant that I knew what I was getting into this time around.

One of the achievements this year was to build a game using aggregated data. After Friday’s video keynote and kickoff meeting, the first idea I pitched was a trading card game where the deck is built from the list of people you follow on twitter. While that game didn’t gain enough traction to win a team, other jammers did grab on to the idea of twitter integration. My friend Ryan came up with a pitch of his own, and a platformer originally pitched as TwitAssassin came to life as @TwitApocalypse!

TwitApocalypse has a pretty silly premise: You are the grim reaper, and you have overslept the end of the world. Upon waking, you must use twitter to find and eliminate the survivors. Based on the idea of culling the people you don’t care about from your twitter list, the goal of the game is to traverse a platformer level and gruesomely destroy your friends. The game tracks who has tweeted most recently, and gives you a ‘Kill List’ of recent tweeters—These are your priority targets, and you get a bonus for taking them out. Killing somebody not on your list results in a penalty.

We had an awesome group of people working on this project: Ryan Kahn, Darius Kazemi and Imran Malek handled the programming; Shervin Ghaemmaghami served as our voice actor and narrative designer; Vytenis Krukonis and I took care of the art; and audio genius Akash Thakkar came on mid-Saturday to help us with sound and music. It was a great group, and I hope to continue working with this team on future projects.

Just as last year gave me an opportunity to stretch my musical skills, this game jam saw me doing my first ever pixel art animations. While previous projects had involved some pixel art, I’d never tackled anything as complex as our grim reaper player character. Despite my lack of experience I am extremely happy with how it turned out, and I will post an animation demo of the character soon. In the meantime, you can check out some of @Death’s poses there to the left.

Parallax & CSS3

I’m spending the bulk of this weekend at the HTML5 Tools Jam organized by my friends Darren & Darius of Boston Game Jams. I am working towards adding parallaxing background support to the ALES level editor for the Akihabara HTML5 game engine. I have the benefit of direct access to the creators of ALES, the aforementioned Darren Torpey & Darius Kazemi, but my first goal didn’t even involve Akihabara: I just wanted to see if there was a way to use CSS3′s support for multiple backgrounds to create a parallax effect within a div. As you can see above (if you’re using Chrome, Safari or Opera), it does!

The above div contains two .png background images with a repeat-x property specified. Just as you define multiple backgrounds through comma-separated url() statements, so can you change the position of all background images within a div by using JavaScript to pass comma-separated background positions. In this case I’m using setInterval to quickly create a continuous animation:

setInterval(function() {
    pos1+=4;
    pos2+=1;
    $('#css3parallaxdemo').animate({
      'background-position': pos1+'% bottom,'+pos2+'% bottom'
    },20, 'linear');
}, 20);

The easy part done, I am looking forward to diving into ALES. It’s doubtful I will be able to get full two-dimensional parallax motion ready by the end of the weekend due to other commitments, but many other people here are also working on ALES and I’m looking forward to seeing where the platform goes. (I recommend taking a look at Ryan Kahn’s Akihabara plugins system as an example of awesome recent developments.)

iPhone Game Best Practices

I log more hours on my iPhone these days than on any other gaming device—the games are great, and it’s always with me when I have downtime. Despite all that, there are some things about iPhone games that drive me up a wall. In lieu of a list of top games or some such, here are five best-practice suggestions for iPhone games in 2011.

  1. For god’s sake, don’t reset to my last save when I get a call! The iPhone is a phone, guys, not a dedicated device: your users are always going to be multitasking. Punishing them for it is just mean. Offender of choice: GTA: Chinatown Wars. I should not have to engage airplane mode to play this game safely.
  2. Let me control the volume. I think Steambirds was the first offender I noticed here. If your game is going to let me play my own music in the background, please give me a volume control option for your SFX so I can level the sounds appropriately.
  3. Social Media integration. Canabalt did it well: Give people a very transparent, lightweight way share their scores on twitter. Other games were not so graceful. If I have purchased the game as a stand-alone app, I would prefer it not require me to log into (or worse, create a new) social media account in order to play. I’m looking at you, Rolando. Fix it.
  4. Game Center. This isn’t a strike against developers so much as Apple itself. Why is it so hard to use, and so comparatively useless? Did you forget everything you knew about UI all at once? You’re dominating the market, but you need to get ahead of the XBox Live integration on the Windows Phone.
  5. Tilt controls. They can be intuitive and smooth, but they can also suck. i Love Katamari would have won my instant affection with an option for virtual joysticks—instead, it made me tilt my phone at increasingly extreme angles until I began to feel motion sick. Make them optional, or make your calibration freaking rock. There is no middle ground.

The first point is the kicker. Resume functionality is essential, or we’ll never get past quick-hit casual games on the platform: just because you’re gaming to kill time while you wait for an appointment doesn’t mean you want to lose that time when you have to take a call. I consider it game-breaking to lose progress for any reason out of my control, and I hope that developers (especially those porting games from dedicated hardware) start releasing patches to support the save/resume functionality on display in all the best iPhone games.

The good news? It is possible to patch games, and iTunes makes the process pretty darn easy. Retina display updates, Game Center integration, and control refinements can (and are!) regularly added to older titles, even a year or more after release. It’s encouraging to see developers begin to step away from the fire-and-forget mentality that used to rule the app store. As a gamer I am very glad to have an iDevice, and I am excited to see what the next year brings to the platform

Happy New Year!

This talk is about Content

At the Boston WordPress Meetup this evening, I saw a presentation by Chris Brogan on “The Power of Content.” While everything he said was definitely true—the normal internet user has developed a microscopic web-browsing attention span thanks to twitter, top 10 (and even moreso top 9) lists draw visitors and inspire discussion in your comments, and so on—the presentation left a bad taste in my mouth.

It wasn’t a presentation about the power of content: it was a presentation about how to present and ration information to drive traffic. These things matter, but they have little to do with the underlying content. This is what rankles me, the gap between what I had expected from the talk and what was being presented. I’d gone in expecting a presentation about honing the content you produce, and instead I was reminded of all of the trollish presentation tricks and vacuous social media positioning people use to make up for lack of remarkable content.

“Remarkable” content is an idea I’ve borrowed from my friends at Dejobaan Games, who use it to refer to the way they spread buzz for their games. In short: if you make something worth talking about, people will talk. This kind of “if you build it” approach may not generate the volume of traffic a top 10 list would, but the visitors you do get are more invested in your content when you have earned their attention. This is what I care about. With all due respect to Mr Brogan (and the amount of traffic he maintains speaks for itself!), his definition of ‘content’ has about as much applicability to what I do as these social media strategies.*

All that aside, thanks again to Kurt and James from Boston WP for yet another successful meetup, and see you all at Design Camp Boston!

* (marginally NSFW, for language)