What’s New in WordPress 3.4

Advertisement

With WordPress 3.4 set to arrive this week, it’s a great time to familiarize ourselves with the new features and additions. The new version of WordPress brings many improvements, including custom backgrounds and headers, a live theme-customizer, revamped XML-RPC, better support for internationalization, and many bug-fixes and enhancements. Let’s dive in and see what WordPress 3.4 has in store!

wp34featured-5001

Custom Headers And Background

When WordPress added featured images2 as a core feature in 2.9, a new function was added — add_theme_support. It was (and is) obvious that this is a precursor of things to come: the standardization of theme features. Since its introduction, add_theme_support handles post-formats, automatic feed-links, and now in version 3.4, custom backgrounds and headers will be added to the list.

Adding a Custom Background

To use this feature, just call the add_theme_support() function with ‘custom-background’ as the first argument, and a list of default options as the second. Here is an example showing the basic syntax:

$args = array(
    'default-image'          => get_template_directory_uri() . '/images/bg-default.png',
    'default-color'          => '#fafafa',
    'wp-head-callback'       => '',
    'admin-head-callback'    => '',
    'admin-preview-callback' => ''
  );

  add_theme_support( 'custom-background', $args )

Once the code is in place, you’ll see the changes take effect in the WordPress Admin:

The new custom background facility in WordPress 3.43
The new custom background facility in WordPress 3.4

Adding a Custom Header

Adding the custom-header options work in much the same way. In addition to the new way of defining them, you can now make them flexible in height or width, which is a great asset to theme designers.

$args = array(
    'flex-height'            => true,
    'height'                 => 200,
    'flex-width'             => true,
    'width'                  => 950,
    'default-image'          => get_template_directory_uri() . '/images/headers/header-default.jpg',
    'random-default'         => false,
    'default-text-color'     => '',
    'header-text'            => true,
    'uploads'                => true,
    'wp-head-callback'       => '',
    'admin-head-callback'    => '',
    'admin-preview-callback' => '',
  );
  add_theme_support( 'custom-header', $args );

Once you add this code the relevant controls will show up in the Appearance tab and you will be able to set up your custom header and background-image.

The width and height is now 'suggested'4
The width and height is now ‘suggested’ (displayed in bold text)

Thanks to Chip Bennett5 and Amy Hendrix6 for their excellent posts on this topic.

Live Theme Customizer

I think one of the best features in recent times is the Live Previews or “The Customizer”. As someone who sells themes on Theme Forest, I welcome this addition because the more I can use default WordPress options, the less support I need to provide. The best way to familiarize yourself with this feature is to watch the following great overview from Otto7. I also recommend his article on leveraging the theme customizer in your own themes8.

We’ll be taking an in-depth look at this awesome functionality here on Smashing Magazine, but for this article, the live theme-preview feature is too complex to showcase concisely. If you’d like to get started, do read Otto’s article — it has everything you need to get things set up. Here’s the nutshell version for a quick preview.

The preview facility works in an object oriented fashion. To use it you will need to cover the following steps:

  1. Add the customizer (hook it to ‘customize_register’)
  2. Add an area of customization — a section (using add_section())
  3. Add a setting you want to be able to control (using add_setting())
  4. Add the control which is used to modify your setting (using add_control())
  5. Customize the preview functionality to work in real-time

The live preview is brand-spankin’ new, but it’s already a very powerful tool. It will no doubt receive numerous updates and additions, so theme developers will finally have a common and also flexible way of letting users customize their themes.

XML-RPC Revamped

XML-RPC is a specification and a set of tools that allow software running on different platforms to make procedural calls over the Internet. In essence, it allows communication between WordPress and other software. The most apparent use of XML-RPC is the remote blogging services that are offered by apps like Windows Live Writer and mobile apps.

WordPress 3.4 comes with a number of XML-RPC bug-fixes as well as some heavily requested features like support for post thumbnails, custom post types and taxonomies.

Internationalization Changes

Back in the second half of December last year, WP Polyglots (the translation team) announced9 that they will be pouring a lot of work into the 3.4 release and beyond. As a result there a numerous upgrades in the internationalization functionality of WordPress:

  • Comma-localization (for languages like Chinese and Arabic which do not use the standard comma)
  • Some fields are now forced to be LTR (like password and login names)
  • Translatable spell-checker language
  • Single quotes, apostrophes and primes can be localized
  • Translatable time-zone string
  • Simplification of:
    • Feed-language specification
    • Start of the week
    • RTL language designation
    • Default secret-key text
    • Placeholder text of database constants
    • setup-config.php file translation
    • WP_I18N_* hardcoded translations
  • Translations are now split over three POT files — wordpress.pot, wordpress-admin.pot, and wordpress-admin-network.pot
  • Default WordPress links can be translated
  • Dashboard widgets can be translated

Beginnings Of A New API

While not advertised in the change-logs, Andrew Nacin10 has been working on a new API which will replace the get_themes() functionality.

For now you won’t notice much, with the main difference being that you can place template files in sub-directories. Under the hood, the new class will bring significant speed increases while searching for themes by reducing the filesystem operations to a bare minimum.

As you can see on the main Trac Ticket11 (scroll down a bit in the comments), there has been a lot of work done but the class is only scratching the surface of what we will be able to do later on. Flexible theme-management with better performance will help developers and users out a great deal — I can’t wait to see where this goes!

Bugs and Enhancements

With a total of 401 bugs fixed, 116 enhancements added, 3 requested features built and 52 tasks completed (at the time of writing) there is a lot more to this update than just the main features above. The WordPress 3.4 Track Milestone12 page has all the links and info you need to take a look at all that’s been done, and here’s a quick overview.

  • HTML Support in image captions #1831113
  • Twenty Ten and Twenty Eleven themes updated to support new features #2044814
  • Theme installer supports child themes #1377415
  • WP_Query core performance upgrade #1853616
  • Clicking on an empty space in the toolbar will scroll the page to the top #1875817
  • Incorrectly displayed author meta fields fixed #2028518
  • Failed cURL redirect fixed #2043419
  • Spam comments are now excluded from the dashboard #1422220
  • Theme editor support for special theme name characters #1650721
  • Retina display icons added #2029322
  • Already installed themes excluded from theme search #2061823
  • Args added to the recent post and comments widget #1615924
  • New comments can be added from the editor #1552725

Updates Of External Libraries

It’s always worth checking out the external library update26 for a milestone. This version brings quite a lot, to name just the most important ones:

Want To Chip In?

If you’d like to participate there are still a few days left and you can always help out after 3.4 as well. If you have the coding chops take a look at the open tickets33 for the next major release.

If you’re not a coder, not to worry! Just using and testing the features can be invaluable as well! You can download WordPress 3.4 RC234 or you can install the Beta Tester Plugin35 to grab all the latest nightlies and be on the bleeding edge!

(JS)

Footnotes

  1. 1 http://www.smashingmagazine.com/wp-content/uploads/2012/06/wp34featured.jpg
  2. 2 http://codex.wordpress.org/Post_Thumbnails
  3. 3 http://www.smashingmagazine.com/wp-content/uploads/2012/06/custombg.png
  4. 4 http://www.smashingmagazine.com/wp-content/uploads/2012/06/customheader.jpg
  5. 5 http://make.wordpress.org/themes/2012/04/06/updating-custom-backgrounds-and-custom-headers-for-wordpress-3-4/
  6. 6 http://sabreuse.com/flexible-headers-in-wordpress-3-4-themes/
  7. 7 http://ottopress.com/
  8. 8 http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
  9. 9 http://wppolyglots.wordpress.com/2011/12/18/moving-locale-specific-modifications-to-core/
  10. 10 http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/
  11. 11 http://core.trac.wordpress.org/ticket/20103
  12. 12 http://core.trac.wordpress.org/milestone/3.4
  13. 13 http://core.trac.wordpress.org/ticket/18311
  14. 14 http://core.trac.wordpress.org/ticket/20448
  15. 15 http://core.trac.wordpress.org/ticket/13774
  16. 16 http://core.trac.wordpress.org/ticket/18536
  17. 17 http://core.trac.wordpress.org/ticket/18758
  18. 18 http://core.trac.wordpress.org/ticket/20285
  19. 19 http://core.trac.wordpress.org/ticket/20434
  20. 20 http://core.trac.wordpress.org/ticket/14222
  21. 21 http://core.trac.wordpress.org/ticket/16507
  22. 22 http://core.trac.wordpress.org/ticket/20293
  23. 23 http://core.trac.wordpress.org/ticket/20618
  24. 24 http://core.trac.wordpress.org/ticket/16159
  25. 25 http://core.trac.wordpress.org/ticket/15527
  26. 26 http://core.trac.wordpress.org/query?status=closed&component=External+Libraries&milestone=3.4&group=resolution&col=id&col=summary&col=component&col=owner&col=type&col=priority&col=version&desc=1&order=priority
  27. 27 http://core.trac.wordpress.org/ticket/19887
  28. 28 http://core.trac.wordpress.org/ticket/19969
  29. 29 http://core.trac.wordpress.org/ticket/20339
  30. 30 http://core.trac.wordpress.org/ticket/20559
  31. 31 http://core.trac.wordpress.org/ticket/18309
  32. 32 http://core.trac.wordpress.org/ticket/19311
  33. 33 http://core.trac.wordpress.org/report/6
  34. 34 http://wordpress.org/wordpress-3.4-RC2.zip
  35. 35 http://wordpress.org/extend/plugins/wordpress-beta-tester/

↑ Back to topShare on Twitter

Daniel is not only a web developer who is in love with WordPress, but also the Editor of the Smashing WordPress section. He owns a company called Bonsai Shed where they make web apps and premium themes like Musico and Estatement.

Advertising
  1. 1

    Very awesome! Love seeing the WP improvements. Makes me feel very secure in my future development for my clients and their WP sites.

    0
  2. 2

    I’m wondering when WordPress would change the XML-RPC to JSON-RPC..

    0
  3. 3

    Don’t get me wrong, I love WordPress but the 3.4 update doesn’t seem like that big of a jump when compared to other version updates. I really wish they’d rewrite how media is handled from the ground up. Especially with galleries. When you can’t remove images from galleries without deleting them from the media library and re-uploading them…that’s a problem. Okay, enough with my rant. I know this isn’t the place for that ;)

    0
    • 4

      Couldn’t agree more.

      0
    • 5

      Gioacchino Poletto

      June 14, 2012 4:18 am

      You are right!

      0
    • 6

      I agree with you, but WordPress is progressing forward quickly nonetheless, I’m sure they’ll get to that part as well. If you’re a developer you can actually add the feature yourself into the proposed core changes :)

      I think media management has been a BIG problem for a while now. I also hope that it gets addressed soon :)

      0
    • 7

      Oh so true.

      Going to start a new project which is going to be having “fun” with that topic a lot .. so if those self-proclaimed “Code is beautiful”-WP-Core-Devs don’t get the media troubles fixed in 3.5, I gonna pour in a fuckload of energy into developing a drop-in replacement (which of corpse the aim to being an easy replacement of the current “media management”).

      8 fucking years later – and still no proper media management? wtf!

      cu, w0lf.

      0
  4. 8

    I wish WordPress would simply update their Content Management System to some better organization. I’d like to see the ability to control sub-folders and better options on where media gets placed after being uploaded. Maybe batch image resizing options.

    0
    • 9

      You can do batch image resizing with the excellent Ajax Thumbnail Rebuild plugin. Combined with defining custom image sizes its all I need!

      0
  5. 10

    Andy Feliciotti

    June 13, 2012 6:02 pm

    Background support, brilliant, glad to add this to my next theme :)

    0
  6. 11

    Right just in time to introduce some of the update features in WordPress 3.4, finally we can have more flexible theme customization built-in rather than going through tone of codes :) Love the custom background feature.

    0
  7. 12

    I agree with Matt Rittman. I feel like this update is more applicable to building customizable themes for resale, not necessarily for straight-ahead web design. I love the bug-fixes, performance upgrades etc., but honestly I personally could care less about creating making theme customizations easier. The last thing I want is for clients to have MORE control over the design!

    The most significant change I can see in regards to sites we will be building is HTML captions.

    What we really need is a better media management system. After that, IMO better content area management would be idea (e.g. better WSYWIG, ability to more easily customize layouts in the admin area, etc.).

    No love lost to the WP dev team! This particular update just doesn’t excite me much.

    0
  8. 13

    Finally it got the feature I desire the most. Customization of a theme before installation. I hope designers implement it soon on their upcoming themes.

    0
  9. 14

    Wasn’t custom background support already added a while back?

    0
  10. 16

    I was just reading the specs on WordPress’s site, but I find this article to be much more useful – great post!

    0
  11. 17

    Sounds good, waiting for 3.4.

    0
  12. 18

    In my opinion WordPress development team should do one release concentrating only on performance and making memory usage smaller.

    If I have to pick one important upgrade in this release, it is the splitting of the pot-file in three files. Most of the websites need to be translated only in front end.

    Things like theme customizers are only bloat.

    0
    • 19

      I agree with the first part of your comment but not the second. WordPress can get a bit unwieldy if you have a big site but if you build it smartly it shouldn’t be a problem really.

      I don’t agree that the theme customizer is bloat though. It does not use resources at all since it is not used for loading the site but adds a LOT to people who develop themes for marketplaces. I’ll grant you that this is a relatively narrow niche but it contributes to the availability of customizable yet standardized themes which is a great help.

      0
  13. 20

    Maybe it’s me, but why does WordPress make us add code to files? When they update, why don’t they just automatically add the code to the appropriate files so the functions are already in place when we upgrade? This would be very beneficial to people (like me) who DO NOT want to constantly futz with code. Aaaargh!

    0
    • 21

      Are you sure you’re doing it right? You should be able to upgrade WordPress without fiddling about with anything at all. You can just go to upgrade in the dashboard and all should be well!

      0
  14. 22

    Thank you for the great overview! The upgrade offers lots of great new features, indeed, and I am excited for it. If I may, though, I’d like to suggest first backing up your website. In the event that the update does something to your site, CodeGuard (www.codeguard.com) will let you revert to the previous version with the click of a button.

    I hope this is of help.

    0
  15. 23

    Don’t get me wrong, I love WordPress. It’s a beautiful piece of machinery. I continue to use it often when it makes the best sense.

    On the other hand, when the going gets rough (read: larger more complex projects with not-so-typical for WordPress functionality) I still believe ExpressionEngine (http://ExpressionEngine.com) is a better choice. EE is the sweet spot between WP’s website in a can approach, and full, ground-up custom PHP dev.

    Yeah I know…I’m going to WordPress hell :)

    0
  16. 24

    While I like how fast WP is progressing, and like the new changes, I am really waiting for WP to get a GUI interface for creating Custom Post Types, Custom Taxonomies, and Custom Fields. I typically use the paid CustomPress plugin, but WP really needs something like that in the core to compete with CMS’s like Drupal.

    0
    • 25

      In the meantime, checkout Eliot Condon’s plugin Advanced Custom Fields. It’s one of the best WP plugins out there and creates a beautiful native looking UI for clients. Way under priced too!

      0
  17. 26

    Sounds good, waiting for 3.4.

    0
  18. 27

    Patrick Samphire

    June 17, 2012 2:26 am

    While I don’t object to the better support for custom backgrounds and custom headers, I can’t help but feel that it is a couple of years out of date. With Responsive Design becoming increasingly important, those customizing their sites will need to be able to add multiple backgrounds and headers for different break points.

    Obviously, developers can add this functionality to their themes, but it would nice if it could be baked in as this basic functionality, which is clearly designed for fixed-width sites, is.

    0
  19. 28

    I like the live updates feature.

    0
  20. 29

    I’m wondering when WordPress will make responsive images a key part of its functionality, like functions that call smaller file sizes for smaller screens and edit image options that don’t give images fixed widths in the html.

    0
  21. 30

    WordPress 3.4 is awesome ,,i used it
    See my blog
    http://www.designaeon.com

    0
  22. 31

    There is a bug in version 3.4 though..
    I don’t know if any of you noticed it but the custom fields won’t let you
    update or add a field using Ajax.
    try using custom fields in the latest WP version and see what I mean.
    the way you can use custom field is updating the whole post since the Ajax is not working.
    hope they will fix it in the next version.

    0

Leave a Comment

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or else it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!

↑ Back to top