WordPress 3.1: What’s new

UPDATE 2011-02-23. WordPress 3.1 was released today! Official Announcement.

The first release candidate of WordPress 3.1 came out in 25 December 2010, and the final release is now close.

Coming 6 months after 3.0, a version that brought many major changes, including the merge with WordPress MU, version 3.1 is not as ambitious in scope. One reason for this is that development time in this cycle was divided between WordPress itself and the official Wordpress site, WordPress.org, which received several updates and improvements.

Even so, WordPress 3.1 represents a large amount of work and brings hundreds of fixes and improvements, large and small, as well as a considerable number of additions, three among which stand out: AJAX-powered lists in all administration areas, advanced taxonomy queries and meta queries, and a new Network Admin area (for multi-site installations).

CONTENTS

  1. Known issues and backwards compatibility
  2. Highlights
  3. Developers
  4. Tickets
  5. Changes
    1. New
    2. Fixed
    3. Modified
    4. Optimization
    5. Other
    6. Third-party
    7. XML-RPC
    8. Functions and classes
    9. Hooks and constants
  6. Epilogue
  7. This document

1. Known issues and backwards compatibility

Nothing frightening yet.

Backwards compatibility is very good. If it is any indication, all of the about 20 plugins used in this site work fine with WordPress 3.1.

2. Highlights

2.1. Administration bar

The Admin Bar is the most obvious new feature in WordPress 3.1. It appears at the top of the page when you are logged in and displays links to commonly accessed areas of the dashboard as well as notifications for new comments and for available updates.

WordPress 3.1, the administration bar in a single-site setup WordPress 3.1, the administration bar in a multi-site setup

The new administration bar in a single-site and in a multi-site setup

Its design and layout are well considered and it works well. The parts of it that I have found most useful up to now are the Edit Page / Edit Post links and the Updates notifications (the Updates item appears only when there are updates available.)

In a single-site installation the Admin Bar appears only on the front-end. In a multi-site installation it appears on the front-end and on the the dashboard. These are the default settings, which you can change at your profile page. If you don’t care at all for the new Admin Bar, you can also disable it, again from your profile page.

DEV. The Admin Bar is extensible, which means that plugins and themes can modify it to add or remove items. One plugin that already does this is the Debug Bar, which adds an extra item to display useful debugging information:

WordPress 3.1, Admin Bar, Debug Bar plugin

The Debug Bar plugin is available from the official repository. See westi’s introduction for more:

2.2. AJAX techniques for better list browsing

UPDATE 2011-01-24. The AJAX infrastucture was removed in RC3 and will not be in the final release of WordPress 3.1. There was not enough time to make it work well enough and to make it work in a way that was backwards compatible. The sortable columns were retained and are now the major new improvement in list browsing.

Practically, the use of AJAX techniques means that browsing dashboard lists, e.g. the list of all your posts or the list of all comments, is now faster, more responsive, and also that all dashboard lists are now sortable by column. See the screenshot for a quick explanation:

WordPress 3.1, AJAX techniques for better list browsing

This was a large undertaking and required a lot of new code, probably more than any other new feature in this version. As a result, a few small things here and there may not work as well as they should yet, and there are a few improvements left to be made. Even so, I find that the ajaxification of the dashboard lists is the most significant improvement WordPress 3.1 brings to its users.

2.3. Internal linking

If you link often to existing content in your site, this is a new feature you will appreciate.

The link dialog of the visual editor now has an extra area that lets you make an internal link with one click. It presents a list of all your published posts and pages in reverse chronological order (latest on top) and it can also filter the list of posts and pages based on what you type in the search box:

WordPress 3.1, easy internal linking from the visual editor

Internal linking in WordPress 3.1

Please note that Internal Linking is implemented as extension of the visual editor, which means that it is not available on the HTML view or when the visual editor is disabled. If you want easy internal linking in those cases, you can try the Link to Post plugin, which also works in WordPress 3.0:

A THOUGHT. I am not certain that Internal Linking needed to be implemented as a core feature. Maybe it would be better to implement it as a stand-alone extension/plugin for the visual editor. Why? Because the more features WordPress core gets, the more difficult it becomes to maintain.

2.4. Post formats

“Post formats” is a new term in WordPress but the concept and the need are old: How to present all posts of a certain type in a distinct style and layout? For example, how to style all “asides” differently from other posts?

This was already possible in WordPress and it has been implemented in various ways by WordPress themes. The most common approach was to put special posts in a special category and then apply a special style to posts of that category. K2, for instance, has been doing that for as long as I remember, since 2005 or 2006: It offers an option to style all posts of a particular category as “asides”.

Now, what the new “post formats” of WordPress 3.1 aim to do is promote a standard implementation of this concept that is easier for users, easier for developers, and also consistent and portable between themes and between languages.

If your theme supports posts formats, you can now see them and can select one when you write a post. WordPress then saves your selection along with the rest of the post metainformation (post title, post excerpt, etc.). If you later switch to another theme that supports your selected format, then your posts of that format will continue to be displayed in a special way. If you later switch to a theme that does not support post formats, then, simply, your posts of that format will have no special style.

Wordpress 3.1, Post Formats

The post formats that themes can support using the new built-in capability are ten:

  • Standard
  • Aside
  • Audio
  • Chat
  • Gallery
  • Image
  • Link
  • Quote
  • Status
  • Video

(Since the aim was portability and standardization, custom formats beyond these ten are not supported by the WordPress core.)

DEV. For examples of implementation, see codex.wordpress.org/Post_Formats

2.5. Network admin

The Network Admin is a new area introduced to make the administration of multisite setups easier. It is accessible only to network administrators —or “super admins”, as they are often called— and it is meant specifically and exclusively for network administartion tasks, so that network administration stays out of the way of publishing and site management and so that publishing and site management stay out of the way of network administration.

Network Admin replaces the Super Admin menu of WordPress 3.0. (WordPress 3.0 was the version when WordPress MU was merged into WordPress.)

WordPress 3.1, Network Admin WordPress 3.1, Network Admin, Themes

Network Admin screens in WordPress 3.1

2.6. More

Index/Archive pages for custom post types. Something missing from custom post types in WordPress 3.0 was arhive pages. WordPress 3.1 brings archive pages to custom post types too. So, for example, if you have a custom post type Recipes with slug recipes, you can also have an arhive of all your recipes at example.com/recipes.

Exporter/Importer overhaul. The WordPress Exporter and the WordPress Importer were rewritten, to improve performance, add new functionality and address long-standing bugs and annoyances. This was a large undertaking and, it seems, a successful one. Both the new exporter and the new importer work very well and are very fast!

More metaboxes hidden by default on edit screens. In new installations most metaboxes on edit screens are now hidden by default, while the default height of the editor was increased. (You can always reveal or hide the metaboxes you want by clicking on the Screen Options tab.)

Password reset improvements. The process for resetting a lost password is now better. If you are curious to check it out, click on the Lost your password? link on a login screen and follow the instructions.

Search for installed themes. The Themes screen now has a search feature that lets you search among install themes by name and by features. This will be more useful in multisite setups that offer a large variety of themes to their users.

Visual editor improvements. TinyMCE, the base of WordPress visual editor, has been updated to its latest version (3.3) which brings lots of improvements and fixes.

3. Highlights for developers

3.1. Compatibility

Backwards compatibility is in general very good. If you are doing things the right way, using the recommended WordPress APIs where appropriate, you should not see things break. That’s the idea anyway! :-)

Areas that may need attention are highlighted in a series of posts at the WordPress Development Blog:

Independently of compatibility issues, WP Devel posts are always good reading if you develop for WordPress. Here is a selection from the 3.1 development cycle, in chronological order:

3.2. Advanced taxonomy queries

This is one of the most interesting new capabilities in WordPress 3.1 for developers as well as for users. Now, for the first time, you can get posts by combining individual taxonomy queries in several ways — for example, you can get all posts that have a specific tag but not another specific tag and that are found in a specific category.

Usage is simple. Let’s say that I want to get all op111.net posts in the category wordpress that are tagged lang-el. (That is, all posts from the category WordPress that are written in Greek.) The code is:

$my_query['tax_query'] = array(
    array(
        'taxonomy'  => 'category',
        'field'     => 'slug',
        'terms'     => array('wordpress'),
    ),
    array(
        'taxonomy'  => 'post_tag',
        'field'     => 'slug',
        'terms'     => array('lang-el'),
    ),
);

query_posts($my_query);

Conveniently, there is also a shorthand syntax:

query_posts(array(
    'category_name' => 'wordpress',
    'tag' => 'lang-el',
));

It’s also possible to define the relation between the individual queries, which can be either AND or OR (default is AND). And the operator too, which can be either IN or NOT IN (default is IN).

So, if I wanted to get all posts from the category wordpress that are not tagged lang-el, I would use:

$my_query['tax_query'] = array(
    array(
        'taxonomy'  => 'category',
        'field'     => 'slug',
        'terms'     => array('wordpress'),
    ),
    array(
        'operator'  => 'NOT IN'
        'taxonomy'  => 'post_tag',
        'field'     => 'slug',
        'terms'     => array('lang-el'),
    ),
);

query_posts($my_query);

And so on and so forth; the possibilities are many. The usual suspect Otto has written a detailed article:

Meta queries come with similar improvements in WordPress 3.1. You can now query posts based on advanced combinations of custom fields. scribu, who did most of the work on the new advanced queries, has a quick explanation on his site:

3.3. Improved user queries

The new get_users() function, which wraps the also new WP_User_Query class, simplifies user queries a lot. It accepts arguments as an array and returns a list of users based on the defined criteria.

The arguments it accepts are:

  • blog_id
  • count_total
  • exclude
  • fields
  • include
  • meta_compare
  • meta_key
  • meta_value
  • number
  • offset
  • order
  • orderby
  • role
  • search
  • who

get_users() is not yet documented at the Codex but you can get an idea of what it can do and how to use it by looking at WP_User_Query, the class it uses:

4. Selected tickets

  • t5919. Password reset improvements
  • t10187. wp_redirect and canonical redirect do not work as expected on IIS
  • t11420. Easy internal linking from new content
  • t12257. wpdb scales badly due to unnecessary copies of all query results
  • t12891. Advanced multi-taxonomy queries
  • t13324. Limit auto-generated passwords to alphanumeric chars
  • t13818. Index/Archive pages for custom post types
  • t14062. Some Location headers use relative URLs
  • t14122. Custom capabilities broken on custom post types
  • t14424. Eliminate dynamic function definitions, i.e. create_function()
  • t14435. Network admin
  • t14494. Move is_*() functionality (AKA conditional tags) into the WP_Query class
    • t14729. Fatal errors after r15531 when conditional tags are used too early
  • t14508. Always require wp-db.php
  • t14579. Ajaxify list-type screens in dashboard
    • t16262. Remove AJAX and extensibility from list tables
  • t14642. Support for Facebook’s HipHop
  • t14696. Personal dashboard
  • t14772. Administration bar
  • t14820. Allow WP XML-RPC library to be extended
  • t14897. Network admin screen for enabling/disabling/upgrading themes
  • t15170. Network admin pages don’t scale
  • t15824. Introduce _doing_it_wrong() to mark incorrect use of functions

5. Selected changesets

This part offers a selection out of the total of changes that went into WordPress 3.1. Links starting with r (e.g., r12345) point to changesets. Links starting with t (e.g., t12345) point to tickets.

5.1. New functionality

5.2. Bug fixes

  • r15328. Fix is_site_admin() when passing a username. See t14046. — 3.0 also
  • r15346. Use WP_PLUGIN_DIR. See t14070. — 3.0 also
  • r15377. More judicious correction of capital P to avoid bungling reasonable URLs. See t13971.
  • r15437. Hex octets are case-insensitive. Don’t 301 if only case differs. See t14292. — 3.0 also
  • r15473. “login”, “setup”, “backup” are not verbs.
  • r15554. Make smilies links SSL-aware. See t14360.
  • r15584. In current page highlighting logic apply untrailingslashit() to everything so that slash additions or omissions still match. See t14208.
  • r15614. Don’t show default password nag on profile screen. See t14861.
  • r15659. Only show Password Strength Meter when JavaScript is available. See t14943.
  • r15665. Add missing Moderate Comment title to comment.php. See t14139.
  • r15670. Fix comma splice in sample About page.
  • r15707. Fix canonical redirection for permalinks containing %category% with nested categories and paging. See t13471. — 3.0 also
  • r15709. Fix nav menu box search. See t14335.
  • r15877. Push capital P filter back behind wpautop, to catch Wordpress after opening HTML tag.
  • r15918. Fix media dialog keypress handling. See t14394.
  • r15960. Attempt at fix for URL encoding issues with UTF-8 chars. See t10249.
  • r15966. Fix custom background selector for IE7 in Appearance › Background. See t14152.
  • r16111, r16279, r16948. Also capture ! (exclamation mark) when making URL clickable. See t14993.
  • r16178, r16179. Don’t assign subscriber role if user already has role for blog. See t15316.
  • r16230. Remove nofollow on comment reply links. See t10550. — SEO improvement
  • r16444. When inserting image via oEmbed, wrap in link pointing to original location. See t14945.
  • r16449. Expose 1-column option in gallery settings. See t14836.
  • r16542, r16543, r16544. Cast term_id to integer for queried_object_id. See t14590.
  • r16624. Prepare properly. — 3.0 also
  • r16637. Drop pingback/trackback blogroll whitelisting. (Easy to abuse.) See t13887. — 3.0 also
  • r16647, r16648. Fix bulk comment keyboard shortcuts. See t15571.
  • r16663. Allow long plugin upgrade notices to wrap. See t14068.
  • r16814. Keep Dashboard RSS widgets in same place when configuring. See t14785.
  • r16846. Make get_header_image() SSL-aware. See t14835.
  • r16870. Don’t clear used username in login form. See t14031.
  • r16903. Use HTTPS for preview links if is_ssl(). See t13328.
  • r17061. Fix guid generation for page auto drafts. See t15041.
  • r17284. Show author dropdown in quick edit even when there is only one contributor-or-higher user and the post belongs to someone who no longer has contributor-or-higher access. See t14420.
  • r17260. Disallow self-reference on RSS widget save, which would DoS a site. Checking home/siteurl should cover vast majority of cases. See t8910.

5.3. Modifications, enhancements, improvements

  • r15445. Set default posts per page to 20. See t14342. — 3.0 also
  • r15457. Update WordPress blog URL from wordpress.org/development to wordpress.org/news.
  • r15469. Only employ maintenance_mode() on MS or if updated plugin/theme is active. See t14393.
  • r15553. Link directly to comment in email notification. See t12797.
  • r15555, r15976. Hide more meta boxes by default in edit screens. See t14212.
    • r17294. Hide the many extraneous meta boxes for pages by default too. See t14212.
  • r15588. Add second Save button for custom nav menus at bottom. See t14265.
  • r15687. Allow search in archive pages. See t14831.
  • r15697. Preserve search terms on plugin management screens during actions. See t14905. — 3.0 also
  • r15722. Use separate AJAX spinners for Save Draft and Publish buttons. See t14582.
  • r15757. Update via AJAX the sample output of custom date/times on Options › General. See t12636.
  • r15710. Improve password reset process. Let user define new password. See t5919.
  • r15682. Remove set-cookie redirection workaround for IIS 3/4/5. See r2436, t10187.
  • r15961, r16652. Importer and exporter overhaul. See t15197.
    • EXPORTER
      • Add author information
      • Greater usage of slug identifiers
      • Don’t export auto-drafts, spam comments, or edit lock/last meta keys
      • Inline documentation improvements
      • Bump WXR version to 1.1, but remain back compat in importer
    • IMPORTER (plugins.trac.wordpress.org/changeset/304249)
      • Use XML parser where available (SimpleXML, XML Parser)
      • Proper support for navigation menus
      • Many bug fixes, specifically improvements to category and custom taxonomy handling
      • Better author/user mapping
  • r16427. Make clear we are installing the American English version, so that message makes sense in non-American English environments. See t14467.
  • r15946. Disable dropdown when Latest posts is selected on Settings › Reading. See t15205.
  • r16145. Blue theme refresh, first pass. See t15207.
  • r16304. Don’t notify author when they posted or moderated the comment. See t12774.
  • r16223. Send moderation emails to post author: An interim solution of emailing the post author as well as the admin if author has proper capabilities. Ideally these will become individual options. See t6286.
  • r16284. Restrict auto-generated passwords to alphanumeric characters (so that double click selects whole password). See t13324.
  • r16285. Enclose password reset link in <> to protect it in some email clients when wrapped. See t14140.
  • r16651. Don’t nag to Change Permalinks if permalink structure is defined. See t13918.
  • r16696, r16701, r16702, r16703. Standardize on “Update” for Update/Upgrade messages. See t14107, t15656.
  • r16821. Include username in incorrect password message. See t14575.
  • r17225. More room for your content! Increase default post edit rows as the meta boxes are now all hidden by default. See t14212.
  • r17288. Remove TinyMCE media plugin. See t14647.
  • r17301. WordPress contains libraries only available under the GPL v2 or later. No one cares about the GPL v1 anymore. We are now specifically saying that WordPress is available under the GPL version 2 or (at your option) any later version. This was discussed with the entire core team.

5.4. Optimization

  • r15287. In install_popular_tags() use site transient rather than own caching. See t13108.
  • r15546, r16034, r16035, r16312, r16313, r16317. Don’t use create_function(). See t14424, t14579.
  • r15559. Do not run kses on display filters for front page views. See t14758.
  • r15585. More efficient calendar queries. See t8351.
  • r15608. More efficient is_super_admin(). Don’t call new WP_User on current user. See t14842.
  • r15636, r16300. Faster is_serialized() with strpbrk(). See t14429.
  • r15641. Don’t fetch theme_roots transient on every page load. Avoid it altogether if there is only one theme dir. See t14911.
    • r16424. Register the default theme dir in wp-settings.php so that it is registered even when get_themes() doesn’t run. Fix counting of theme dirs. Add option to get_raw_theme_root() to disregard the current theme root cache. See t14911.
  • r15660. get_boundary_post(). Sort by post_date, not ID. See t14035.
  • r15700. update_post_caches(). Cache terms under more scenarios. See t15026.
  • r15701. get_boundary_post(). Don’t load taxonomy and postmeta cache. See t15028, t14796. — Reduces queries for rel nav links.
  • r15816. Improve regex performance in wptexturize(). See t15093.
  • r15833. Cache invalidation for get_blogs_of_user(). See t14379.
    • r16225. Prime blogs of user cache from old cache to avoid mass DB requests on upgrade. See t14379.
  • r15919. Do not set role if it is the same. See t14708.
  • r15932. Don’t make redundant str_replace() calls in link-template.
  • r15949. Avoid extra conditional in subdirectory rewrite rules. See t15083.
  • r16029. Remove unnecessary wp_cache_delete() calls. See t14080.
  • r16096, r16104, r16105. Optimize menu item creation. See t14415.
  • r16204. post_class(). Skip category/tag queries if post type doesn’t support them. See t15322.
  • r16206. get_page_by_path(). Eliminate some queries by consulting cache. See t11373.
  • r16437. Use wp_cache_add() instead of wp_cache_set() in update_meta_cache(). See t15452.
  • r16596. Meta data caching improvements. See t15545.
  • r16958. Add theme_mods option if is_admin. See t14828.
  • r16974. Fetch only the required field in wp_dropdown_users(). See t14572.

5.5. Other

  • r15275. Development of WordPress 3.1 starts.
  • r15356. Don’t use deprecated function. Blacklist braces. — safecss_filter_attr()
  • r15363. Restore trackback_rdf(). Reverts r13991. See t11139. — 3.0 also
  • r15371. Pass feed type from the_content_feed() to get_the_content_feed(). See t14214.
  • r15450. Make posts per page filters consistent and backwards compatible. See t14135. — 3.0 also
  • r15471. More curses on PHP 5.0.5. (Return by reference from internal functions causes fatal error.) See t13757, t14160. — 3.0 also
  • r15521. Some escaping. — Mentioned for instructive value
  • r15531. is_*() (conditional tags) WP_Query methods. See t14494.
  • r15533. We cannot say that WordPress as a whole is GPLv2 (i.e. “GPLv2 only”). Go back to just “GPL”. Reverts r13516. — 3.0 also
  • r15537. Remove WP_USE_MULTIPLE_DB. Introduce init_charset() and set_charset(). See t14672.
  • r15549. r15563. Don’t use id global anymore. Use get_the_ID(). See t11624.
  • r15550. Update last_changed when cleaning comment cache. See t14713.
  • r15560. Add a note about REMOTE_ADDR behind proxies.
  • r15582. Don’t hardcode pagination base (page). See t12507.
  • r15583. Don’t cache terms indefinitely. Use TTL of one day. See t11431.
  • r15591. Only run update checks on main site. See t14554.
  • r15596. Introduce edit_comment meta cap. See t14520.
  • r15638. Always include wp-db.php. Prevents a conditional include and allows database dropins to cleanly extend the wpdb class. Move require_wp_db() to load.php for consistency with bootloader helpers. See t14508.
  • r15643. Make login CSS more flexible. See t7763.
  • r15672. Do thorough resets in init() and init_query_flags(). See t14976.
  • r15720. Account for Twenty Ten in theme name collisions and properly fall back to it in get_current_theme(). See t15719.
  • r15736. Have theme mods rely on theme slug instead of theme name. See t15048.
  • r15749. Don’t generate incorrect content types when files are requested with query strings. See t14450.
  • r15770. Make parse_request() set empty variables. See t10710.
  • r15772. Make it explicit that you can set fallback_cb to FALSE in wp_nav_menu().
  • r15798. Don’t show taxonomy term’s descendants in parent selector. See t14663.
    • r15806. Prevent post and term hierarchy loops. See t14662.
  • r15808. Display mysql_connect errors when WP_DEBUG is enabled. Always die if we can't connect to the database; no point in going any futher. See t14654.
  • r15811. Require plugin.php earlier so all pluggables can get at it. See t15042.
  • r15818. nav_menu and post_format taxonomies should not be public. See t15107.
  • r15836. Allow flagging blog as mature via URL. Move some actions into update_blog_status(). See t14385.
  • r15872. Schedule update checks from an init hook. See t15148.
  • r15890. Rough first pass on map_meta_cap for custom post types. See t14122. See Changes to meta capability handling in 3.1.
  • r15920. Default send to editor to true if the post parent is empty. See t14133.
  • r15948. Idempotence for sanitize_user(). Make sanitize_key() match its phpDoc. See t15198.
  • r15971. Fix infinite recursion caused by malformed URLs. See t14655.
  • r15973. Refactor wp_get_recent_posts() to use get_posts().
  • r15984. Specify feed type in the_category_rss() call. See t14451.
  • r16007. Use the API to build site URLs.
  • r16009. Move registration.php functions to user.php. Deprecate registration.php; everything is now included by default. See t13761.
  • r16012. Don’t call activation hooks when upgrading. See t14915.
  • r16028. Add class to “Your comment is awaiting moderation” in the comment walker and in Twenty Ten’s callback. See t15206.
  • r16030. Use correct variable in edit_bookmark_link(). See t14141.
  • r16068. Don’t pass deprecated argument in discover_pingback_server_uri().
  • r16093. Move an array cast further down the stack in wp_get_nocache_headers(). See t13965.
  • r16095. Add menu-item-object-$object class for custom menus. See t14053.
  • r16135. Die if user doesn’t have caps for post type. See t15259.
  • r16136, r16415. Admin CSS cleanup. See t14770.
  • r16197. Add Post Format support to Twenty Ten (Aside and Gallery). See t14746.
  • r16207. Don’t anchor regex. Fix for sanitize_email(). See t14628.
  • r16215, r16552. More precise regex in get_file_data(). See t15193.
  • r16340. Use square brackets instead of braces for string access. See t13900.
  • r16365. Improve hook readability via braces. See t15422.
  • r16392. Fallback to only RTL attributes in wp_die() HTML tag if it’s very early in the execution. See t6132.
  • r16401. Use user_trailingslashit() in get_author_posts_url(). See t15441.
  • r16539. Escape URL in wp_link_pages(). See t14271.
  • r16564. Updated WebPI parameters.xml file. — IIS branch
  • r16566. Let SimplePie do more of the date handling for us.
  • r16585. Tighter match for the ACL. — IIS branch
  • r16587. Things go bump in the night. — WordPress 3.1 Beta 1
  • r16666. Don’t show permalink box in edit screen if post type is not publicly queryable. See t14321.
  • r16667. Remove archaic reference return in get_children(). See t12372.
  • r16670. Throw WP_Error if post_type passed to register_post_type() is too long. See t13709. — 3.0 also
  • r16688. Include parent theme CSS before child’s in add_editor_style(). See t14430.
  • r16691. Clean cache when deleting term. See t15651.
  • r16694. Add class to Tag Cloud widget DIV. See t12602.
  • r16728. Unescape ampersands before making oEmbed request. See t14514, t11311.
  • r16738. Get rid of niggling hardcoded blogs.dir path. See t15383.
  • r16742. Highlight home page Custom Nav Menu item even when extra query args are present in the URL (only if all other highlights fail). See t13994.
  • r16752. Add jquery-ui-sortable dependency to nav-menu. See t15622.
  • r16783. Fix background colors for Select Files upload buttons. See t8545.
  • r16797. Enable canonical redirections for permalink-suporting IIS. See t10187.
  • r16808. Remove stripslashes() from get_blog_option(). No longer needed. See t12560.
  • r16812. Fix error display in media form. See t13810.
  • r16826. Link to unobfuscated JavaScript. (To comply with GPL.) See t15262.
  • r16864. wp-caption-text class for the gallery shortcode caption. See t14411.
  • r16872, r16877, r16878. Check if WP_Query has returned any posts before proceeding. See t15771.
  • r16906. Return correct HTTP status code (410) for archived, deleted, and spam sites. See t15799.
  • r16920. Fix canonical paged/feed redirects. See t14288.
  • r16922. Remove internal ceilings from Recent Comments and Recent Posts widgets, and from dashboard widgets. See t14543.
  • r16932. 3.1 Beta 2.
  • r16939. _doing_it_wrong(), first pass. New function to display notifications for incorrect use of functions. See t15824.
  • r17068. Prevent fatal error if conditional tag is called before $wp_query is set. See t14729.
  • r17102. Translations in title attributes require esc_attr(). — Mentioned for instructive value
  • r17085. Don’t check upload space site option if option is disabled. See t13601. — Multisite
  • r17148. Happy holidays :D — WordPress 3.1 Release Candidate 1
  • r17171. Don’t be case sensitive to attribute names. Handle padded entities when checking for bad protocols. Normalize entities before checking for bad protocols in esc_url(). — 3.0 also — Security
  • r17322. Remove AJAX from list tables, first pass. See t16262.
  • r17355. WordPress 3.1 Release Candidate 3.

5.6. Third-party libraries

5.7. XML-RPC

  • r16064. r16065. WP_HTTP_IXR_Client. Introduce and use in core. Extends IXR_Client and switches it to using the WordPress HTTP API instead of fsockopen(). See t10588.
  • r16256. Support optional number of posts in the following XML-RPC API calls:
    • blogger.getRecentPosts
    • metaWeblog.getRecentPosts
    • mt.getRecentPostTitles
  • r16484. Expose post format details in XML-RPC. See t15405.
    • New method: wp.getPostFormats
    • New field in methods dealing with posts: wp_post_format
  • r16809. Use is_callable() instead of method_exists(). See t14933.
  • r16824. Work around some notices for unset variable in xmlrpc.php. See t10665.
  • r15975. 4th argument of wp.getOptions is optional. Don’t notice if it is absent.
  • r15980. Expose the media options over XML-RPC. Fixes t15153.
  • r16016. First pass at 'wp.getMediaItem' and 'wp.getMediaLibrary'. See t15151.
  • r16046. phpDoc and a bug fix for the new media XMLRPC functions. See t15151.
  • r16508. Ensure that we return post IDs as strings to honour API defintions. See t15517.
  • r16572. Cast to string so we return the correct datatype. See t15517.

5.8. Functions/Classes

NEW FUNCTIONS AND CLASSES

  • r15491. WP_User_Query. The new WordPress user query class. See t14579.
  • r15723. WP_Comment_Query. WordPress Comment Query class.
  • r16849. WP_Tax_Query. Containter class for advanced taxonomy queries. See t15752.
  • r15467. unregister_nav_menu(). See t14001. — 3.0 also
  • r15481. is_network_admin(). See t14435.
  • r15491. get_users(). Retrieves users matching criteria. Uses WP_User_Query. See t14579.
  • r15558. is_blog_admin(). See t14763.
  • r15598. single_term_title(). Introduced and used in single_cat_title(), single_tag_title(). See t14161.
  • r15574. wp_array_slice_assoc(). Given list of keys, extracts slice of array. See t14572.
  • r15601. wp_dequeue_script(), wp_dequeue_style(). See t14815.
  • r15631. get_ancestors(). See t12443.
  • r15677. has_term(), has_category(). See t12526.
  • r15686. wp_list_filter(), wp_list_pluck(). See t15016.
  • r15746. add_screen_option(). Registers and configures admin screen option. See t14696.
  • r15746. get_current_screen(). Gets current screen object (in dashboard). See t14696.
  • r15746. is_user_admin(). See t14696.
  • r15753. remove_menu_page(), remove_submenu_page(). See t12718.
  • r15777. get_post_format(). Retrieves format of post.
  • r15777. set_post_format(). Assigns format to post.
  • r15778. has_post_format(). See t14746.
  • r15792, r15800, r15801. edit_term_link(), get_edit_term_link(), get_term_url(). See t9702.
  • r15806. wp_get_post_parent_id().
  • r15806. wp_get_term_taxonomy_parent_id()
  • r15810, r16061, r16097, r16362. submit_button(), get_submit_button(). New template functions. See t15064. See core for examples of usage.
  • r15819. get_post_type_archive_feed_link(). Retrieves permalink for post type archive feed.
  • r15819. get_post_type_archive_link(). Retrieves permalink for post type archive.
  • r15819. is_post_type_archive().
  • r15819, r16211. post_type_archive_title(). Displays/Retrieves title for post type archive. See t13818.
  • r15929. sanitize_title_for_query(). See t9591.
    • r15930. remove_accents(): Nordic characters fixes. See t4739, t9591.
    • r15931. Also convert uppercase letters in Latin Extended-B. See t9591.
  • r16050. get_current_blog_id(). See t15233.
  • r16073, r16075. translate_nooped_plural(). See t13996.
    • _n_noop() and _nx_noop() now return associative arrays for greater clarity
    • translate_nooped_plural() takes one such associative array and translates it
    • works on both the result from _n_noop() and from _nx_noop()
    • retains backwards compatiblity for the few plugins using _n_noop()
  • r16083. get_dashboard_url(), get_edit_profile_url(). Determine appropriate dashboard for user based on user’s blogs and current blog. See t14696, t14772.
  • r16091, r16114, r16115. get_queried_object(), get_queried_object_id(). Wrappers for $wp_query->get_queried_object() and $wp_query->get_queried_object_id(). Introduced and applied in core.
  • r16154. wp_basename(). i18n-friendly basename() (for media handling, inter alia). See t11887.
  • r16209. user_can(). Whether user has capability or role. See t14602.
  • r16388. set_post_thumbnail(). See t15192.
  • r16431. esc_textarea(). Escaping for textarea input. Applied in core where appropriate. See t15454.
  • r16674. remove_custom_image_header(). See t14903.
  • r16705. get_post_format_link().
  • r16705. get_post_format_slugs().
  • r16720. remove_custom_background(). See t14903.
  • r16721. remove_editor_styles(). See t14903.
  • r16764. can_edit_site(). To replace inline checks on whether site_id is for current network. See t15716.

IMPROVED/MODIFIED FUNCTIONS AND CLASSES

  • r15544. wp_nav_menu().
    • Make menus manipulation easier for plugin developers.
    • Add wp_nav_menu_objects filter, which gets a sorted list of all menu node objects in the currently rendered menu.
    • Add current, current_item_ancestor and current_item_parent boolean member variables to each menu node object, which are true when the item has the current-menu-item, current-menu-ancestor or current-menu-parent CSS class respectively.
  • r15564. wp_insert_post(). Now requires argument. See t14783.
  • r15586. get_term_link(). Second (taxonomy) parameter now optional if passing term object as first arg (which has the taxonomy in it). See t13081.
  • r15587. wp_list_pages(). Supports custom post type links. See t14177.
  • r15589. get_posts(). caller_get_posts renamed to ignore_sticky_posts. See t14624.
  • r15598, r15599. single_cat_title(), single_tag_title(), wp_title(). Cleaned up. See t14161.
  • r15620. wp_list_authors(). New number, orderby and order args. See t10329.
  • r15635. sanitize_key(). Simplified and used in more places. See t14910.
  • r15771. locate_template(). Now accepts string as first parameter. See t15061.
  • r15982. WP_Query. New fields query variable. See t14777.
  • r15626, r15627. category__in(), tag__in() etc. Input does not have to be array. See t14892, t14389.
  • r15661. screen_icon(). New CSS class for post type. See t14959.
  • r15690. wp_delete_category(). Now wraps wp_delete_term(). See t15008.
  • r15828. remove_theme_support(). Now allows disabling custom header uploads. See t14837.
  • r15844. register_post_type(). New show_in_menu arg: Allows post types to be a submenu, accepts boolean and also a parent base. See t14145.
  • r15855. the_terms(). id arg now optional. See t15160.
  • r15856. body_class(). New classes for custom taxonomies/terms. See t15017.
  • r15937. is_archive(). post_type params removed. Use is_post_type_archive() for full context. See t13818.
  • r15968. is_multisite(). Also looks for SUBDOMAIN_INSTALL. See t14536. — 3.0 also
  • r16138. post_class(). New post-password-required class if password required. See t13860.
  • r16139. post_class(). New class for post status, to facilitate styling of private posts. See t15279.
  • r16200. post_class(), body_class(). New classes for post formats. See t14746.
  • r16251. register_post_type(), register_taxonomy(). New menu_name label (defaults to name). See t14832.
  • r16283. body_class(). More ID-based classes. See t12397.
  • r16357. check_comment(). Always apply comment_text filter. See t14680.
  • r16432. body_class(). New admin-bar class when admin bar is displayed. See t15455.
  • r16447. is_feed(). Can check for feed format as well. See t15460.
  • r16519, r16520. wp_nav_menu(). New items_wrap argument. See t14235.
  • r17028. Make get_the_taxonomies() take an array of arguments. See t14740.
  • r17107. single_term_title(). Echo or return, not both. See t15939.
  • r16994. network_admin_url(). Now returns admin_url() when not multisite, like its home and site counterparts. See t15840.

DEPRECATED FUNCTIONS AND CLASSES

This part is provided for a quick overview. You don’t need to memorize it or worry about it. Just enable WP_DEBUG and it will tell you if there is anything you should not be using anymore.

  • r15515. print_column_headers(). Use WP_List_Table.
  • r15515. register_column_headers(). Use WP_List_Table.
  • r15531. update_category_cache(). Use global $plugin_page and/or get_plugin_page_hookname() hooks.
  • r15540. get_author_user_ids(). Use get_users(). See t14572.
  • r15540. get_editable_authors(). Use get_users(). See t14572.
  • r15542. get_editable_user_ids(). Use get_users(). See t14572.
  • r15542. get_nonauthor_user_ids(). Use get_users(). See t14572.
  • r15542. get_others_drafts(). See t14572.
  • r15542. get_others_pending(). See t14572.
  • r15542. get_others_unpublished_posts(). See t14572.
  • r15748. WP_User_Search. Use WP_User_Query. See t14579.
  • r16412. update_category_cache(). See t15446.

REMOVED FUNCTIONS AND CLASSES

5.9. Hooks and constants

NEW HOOKS (FILTERS AND ACTIONS)

  • r15316. widget_title. Filter for title of Custom Menu widget. See t14009. — 3.0 also
  • r15490. post_comment_status_meta_box-options. Action to allow plugins to add more options to the comment status meta box easily. See t14544.
  • r15600. force_filtered_html_on_import. Filter. See t14818.
  • r15623. wp_get_current_commenter. Filter for wp_get_current_commenter(). See t14878.
  • r15631. get_ancestors. Filter in new get_ancestors() function. See t12443.
  • r15775, r15791, r15794, r15795. posts_clauses, posts_clauses_request. Filters for WP_Query clauses. See t14997. See wp-includes/query.php for all individual filters.
  • r15805. custom_header_options. Action in custom header screen. See t15119.
  • r15837. schedule_event. Filter for wp_schedule_single_event() and wp_schedule_event(). See t15146.
  • r15917. add_{$meta_type}_meta, delete_{$meta_type}_meta. Actions. See t14173.
  • r15983. add_{$meta_type}_metadata, delete_{$meta_type}_metadata, get_{$meta_type}_metadata, delete_{$meta_type}_metadata. Filters for the *_metadata() functions. See t14766.
    • r16017. Fix inconsistencies in metadata filters. See t14766.
  • r16000. login_footer. Action. See t5919, t15124.
  • r16019. Add filters to WP_Comment_Query. See t15019.
    • r16020. Make comment clauses more similar to post clauses. See t15019.
  • r16038. show_admin_bar. Filter. See t14772.
  • r16047. media_upload_mime_type_links. Filter for media_upload_library_form(). See t6348.
  • r16130. load_image_to_edit_filesystempath, load_image_to_edit_attachmenturl. Filters in load_image_to_edit(), for better contextual filtering of path to image.
  • r16247. enter_title_here. Filter for placeholder in post/page edit screens. See t13386.
  • r16260. admin_title. Filter for document titles of dashboard screens. See t15301.
  • r16446. list_pages. Filter for the titles in Walker_PageDropdown. See t13668.
  • r16522. show_recent_comments_widget_style. Pass __return_false to remove default styles. See t15493, t14876.
  • r17004. network_admin_plugins_action_links. Filter. See t15850.

IMPROVED/MODIFIED HOOKS (FILTERS AND ACTIONS)

  • r15552. Pass more info to following notification filters. See t14743.
    • wpmu_signup_blog_notification_email
    • wpmu_signup_blog_notification_subject
    • wpmu_signup_user_notification_email
    • wpmu_signup_user_notification_subject
  • r15592. pre_comment_approved. Pass some context (commentdata). See t14802.
  • r15802. favorite_actions. Filter. Pass screen context. See t15117.
  • r15896. user_contactmethods. Filter. Pass user object. See t15186.
  • r16275. get_enclosed. Pass post ID. See t14018.
  • r16749. login_form_* filters. Pass args. See t15702.

NEW CONSTANTS

  • r15374. DO_NOT_UPGRADE_GLOBAL_TABLES. See t14221. — 3.0 also
    • r16094. Prevent network creation when DO_NOT_UPGRADE_GLOBAL_TABLES is defined. See t14246.

IMPROVED/MODIFIED CONSTANTS

  • r15911. WP_PROXY_BYPASS_HOSTS, WP_ACCESSIBLE_HOSTS. Now support wildcard domains. See t14636.

6. Epilogue

I hope this little presentation will be useful to you. If you have any question or if you see anything that does not look right, you are welcome to leave a comment.

I wish you a happy 2011 and happy web publishing with WordPress 3.1!

7. Changes to this document

2011-02-23
Link to 3.1 announcement.
Updates, improvements.
2011-01-24
Link to 3.1 RC3 announcement.
List tables wonʼt get AJAX and extensibility in 3.1. Ticket.
Misc updates and improvements.
2011-01-17
Debug Bar screenshot and link to westi’s introduction.
Misc updates and improvements.
2011-01-03
Misc updates and improvements.
2010-12-30
Published.

Comments (3)

  1. I swear, I am not Keyser Soze.

  2. demetris says:

    @The Usual Suspect Otto:

    :-D

  3. Jaco says:

    Very informative post, thanks.

    I just upgraded to 3.1 and was wondering what all the improvements are that will make my life easier.

    The internal linking is the winner so far, although if I can figure out the custom post thing and make it work like Tumblr, then that will score 1st prize.

    Thanks again for the effort.

Write a comment

Your email address will not be published. Required fields are marked *