Yay For Flexible Plugins. Boo For Assumptions.
March 25, 2006 11:59 pm Blog Meta, Polls, Tools and Libraries, Web and Web Standards, Word PressWell, I had something of a pleasant surprise, just now. Two Word Press plugins which weren’t expected to work together in fact do quite nicely. I now have inline per-article polling.
[?php jal_democracy(3); ?]
That poll above is the fusion of two plugins – Democracy AJAX Poll, and Exec-PHP. The bulk of the work is just Democracy doing its thing. However, Democracy is intended to be embedded in the site’s theme, such as in a sidebar box; you embed it by calling a function using the poll index as an argument, or blindly, and it’ll use the currently “active” poll. Lord knows my sidebar box is cluttered enough as is, and polls make more sense for me inline to posts than they do other places. Active polls aren’t really my thing, though they may become so in the future (it’d be easy enough to permanently embed an active poll in the side while keeping these inlined ones too.)
In order to get them inlined, I just pulled Exec-PHP to call the Democracy plugin from within a post. It’s quite neat, really. I had to make a trivial batch of edits to Democracy, because Word Press runs nl2br() on the plugin’s output, which injects spurious breaks that I don’t want; really all I did was to remove the whitespace from the plugin’s original output, and everything else Just Worked™.
I continue to be impressed with Word Press.
