WordPress trunk news #15, #16, #17

It’s been a while since news from the trunk have been published on my blog due to the lack of time on my part and the lack of substantially juicy stuff happening in the trunk. With WordPress 3.4 coming up most of the movement in the trunk is related to fixing bugs. So today’s post will combine the 15th, 16th and 17th editions of WordPress trunk news into one post.

WordPress trunk news 15, 16, 17

As of this day, there are 12 active tickets. And with WordPress’s 9th birthday earlier this week (yay!) here’s the latest news from the trunk.

default_option_{$name} filter

changeset 20783

Two new filters have made it into WordPress trunk default_site_option_{$name} and default_option_{$name}. These allow developers to override option defaults, which is pretty awesome. Both filters pass on one argument – the default value passed over from the get_option() function.

Original Gangsta’

changeset 20794

The WordPress HTTP API gets four new functions dealing with Origins, specifically the handling of Cross-Origin Resource Sharing (CORS) scenarios. These functions are:

  • get_http_origin – retrieves the Origin if available, filtered by the new http_origin filter
  • get_allowed_http_origins – retrieves a filtered (allowed_http_origins filter) list of Origins that can later be used elsewhere
  • is_allowed_http_origin – checks whether an origin is one of the allowed ones or not
  • and send_origin_headers which sends out Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers

These are currently used in the Theme Customizer communication schemes.

set_url_scheme

changeset 20828

Another fantastic utility function that can be used by plugin developers to mutate URLs to adhere to a specific scheme – HTTP or HTTPS, for now. An additional set_url_scheme filter allows the developers to take it even further. This function should fix a bunch of cross-scheme and SSL bugs in WordPress when applied.

Character-based word count

changeset 20859

In some languages a character is a word. A new translation-based switch has been implemented where word count mode is adjusted accordingly. Developers are able to find out this character count mode (there can be many valid reasons for doing so) in any future WordPress deployment by comparing the return value of _x( 'words', 'word count: words or characters?' ) against ‘words’ or ‘characters’.


You may have noticed the lack of Theme Customizer updates in my trunk news, there have certainly been a lot of updates, some with new feature additions; however, due to my disinterest in the Theme Customizer and the whole Live Preview scene I’m skipping everything related thereto for now, sorry for this. You can check out the latest changes to the Theme Customizer by issuing a simple search.

Anything I missed?

Have a great weekend ahead!