Development Archives

  1. WordPress Post Format Fallbacks

    Post Format Fallbacks

    While our post formats admin UI is getting a nice warm reception (100+ tweets, pings and comments, wow!), there is a concern that has popped up a few times – one that I included a nod towards in my original post. What happens when publishers put important data in the post format custom fields, then…

  2. WordPress Post Formats Admin UI

    format-standard

    The Post Formats feature that landed in WordPress 3.1 is a great framework feature. I’m leveraging it extensively on this site to drive my link, status, photo and gallery posts. While it is a great framework feature, it only really exists as something developers leverage to extend WordPress. There is no UI that ships with…

  3. wp_publish_post() Does Not Set post_*

    The inline documentation for wp_publish_post() says that it will: Publish a post by transitioning the post status. and that’s exactly what it does. Moreover, that’s all it does. If you are creating a draft post via wp_insert_post() (or wp_update_post(), which calls wp_insert_post()), certain defaults will be set for you when the post status is set…

  4. Wanted: Multiple Incognito Sessions

    Steve laments the lack of easy “Incognito” windows in Firefox. I tried Safari as my primary browser for a few weeks when I upgraded to Lion and I really missed this as well. Once it becomes part of your workflow, it’s really hard to go back. I actually want it to go a step further.…

  5. Modernizr.touch and BlackBerry Browsers

    If you’re using Moderinzr to detect browser support for touch events, be aware that non-touch BlackBerry devices claim to support touch events. As you might expect, the touch events are pretty much impossible to trigger on a non-touch device. I worked around this by making the check for touch vs. non-touch browsers also test for…

  6. Custom Fields vs. Taxonomies

    For years I’ve used custom fields (post meta) in WordPress as a primary storage area for misc. data about specific posts (including pages, custom post types, etc.). Recently, I’ve realized that I should be using custom taxonomies instead of custom fields in a variety of situations. Custom fields are still the right choice for misc.…

  7. Where to Host WordPress Code?

    I talked to a number of developers about at this year’s WordCamp SF about where best to publish WordPress code as a developer. We definitely want to use the SVN repositories on WordPress.org so that released plugins can be easily available to the community, but there is very little developer community there. We’ve also used…

  8. WordPress Filter for Pingbacks

    My team and I have been working on a plugin to enable a better UI for post formats in the WordPress admin (more on this later, but feel free to grab the code and play with it). One of the things we’ve done is standardize on some custom field names for various bits of data…

  9. WordPress GUIDs Must Be URLs

    If you are customizing the GUID value of a post in WordPress, make sure you maintain the format of the GUID as a valid URL format. There are security checks on the value that enforce the URL format. If you pass in a UUID as the GUID value when creating a post, your value will…

  10. Reminder: Post Formats are a Taxonomy

    If you hook in to get_the_terms and try to make a get_post_format() call within your callback without first removing your filter, you’re going to get an infinite loop (perhaps a seg fault). Good times!

  11. Use $content_width to Set Width of oEmbeds in WordPress

    If you want resulting oEmbed code to scale to a specific size (width) in WordPress, you can do this really easily by setting the $content_width global variable before calling your oEmbed processing. Example: global $wp_embed, $content_width; $content_width = ’600′; // set to desired width $string_with_embedded_content = $wp_embed->autoembed($string_with_oembed_url); I only recently ran across this feature (just…

  12. Detecting Lightboxed Pages in WordPress Admin

    When you want inject something into the WordPress admin, you might not think to account for pages that load inside lightboxes (plugin updates, media upload, etc.). Generally, you don’t want to add your JS/CSS/etc. to these pages. To check for this type of page load, you can check for the IFRAME_REQUEST constant. View the code…