WordPress 3.1 + updated Documentation & new Coda Syntax file

The long awaited WordPress 3.1 “Reinhardt” is now available for download, or you can update from within your dashboard.

Alongside with this update we also updated our documentation to show the new functions and the Coda Syntax Highlighter file to reflect the changes in the 3.1 version tag and include the over 130 new functions.

Here are the highlights of the new version:

  • Internal Linking – click a button for an internal link and it allows you to search for a post or browse a list of existing content and select it for inclusion.
  • Admin Bar – contains various links to useful admin screens. By default, the admin bar is displayed when a user is logged in and visiting the site and is not displayed in admin screens for single blog installs. For multisite installs, the admin bar is displayed both when visiting the site and in the admin screens.
  • Streamlined Writing Interface – new users of WordPress will find the write screen much less cluttered than before, as more of the options are hidden by default. You can click on Screen Options in the top right to bring them back.
  • Post Formats – meta information that can be used by themes to customize presentation of a post. Read more in the article Post Formats.
  • Network Admin – move Super Admin menus and related pages out of the regular admin and into a new Network Admin screen.
  • List-type Admin Screens – sortable columns for list-type screens and better pagination.
  • Exporter/Importer Overhaul – many under the hood changes including adding author information, better handling for taxonomies and terms, and proper support for navigation menus.
  • Custom Content Type Improvements – allows developers to generate archive pages, and have better menu and capability controls. Read more in the article Post Types.
  • Advanced Queries – allows developers to query multiple taxonomies and custom fields.
  • Refreshed Blue Admin Color Scheme – puts the focus more squarely on your content.

_edit_attachments_query_helper

Definition:
function _edit_attachments_query_helper($where) {}

Parameters

  • $where

Source code

function _edit_attachments_query_helper($where) {

	return $where .= ' AND post_parent < 1';

}

11086

_admin_bar_bump_cb

Definition:
function _admin_bar_bump_cb() { ?>

Default admin bar callback.

Source code

function _admin_bar_bump_cb() { ?>

<style type="text/css" media="screen">

	html { margin-top: 28px !important; }

	* html body { margin-top: 28px !important; }

</style>

<?php

}

11076

wp_update_user

Definition:
function wp_update_user($userdata) {}

Update an user in the database.
It is possible to update a user’s password by specifying the ‘user_pass’ value in the $userdata parameter array.

Parameters

  • array $userdata: An array of user data.

Return values

returns:The updated user’s ID.

Source code

function wp_update_user($userdata) {

	$ID = (int) $userdata['ID'];



	// First, get all of the original fields

	$user_obj = get_userdata( $ID );



	$user = get_object_vars( $user_obj->data );



	// Add additional custom fields

	foreach ( _get_additional_user_keys( $user_obj ) as $key ) {

		$user[ $key ] = get_user_meta( $ID, $key, true );

	}



	// Escape data pulled from DB.

	$user = add_magic_quotes( $user );



	// If password is changing, hash it now.

	if ( ! empty($userdata['user_pass']) ) {

		$plaintext_pass = $userdata['user_pass'];

		$userdata['user_pass'] = wp_hash_password($userdata['user_pass']);

	}



	wp_cache_delete($user[ 'user_email' ], 'useremail');



	// Merge old and new fields with new fields overwriting old ones.

	$userdata = array_merge($user, $userdata);

	$user_id = wp_insert_user($userdata);



	// Update the cookies if the password changed.

	$current_user = wp_get_current_user();

	if ( $current_user->ID == $ID ) {

		if ( isset($plaintext_pass) ) {

			wp_clear_auth_cookie();

			wp_set_auth_cookie($ID);

		}

	}



	return $user_id;

}

11051

wp_update_network_counts

Definition:
function wp_update_network_counts() {}

Update the network-wide counts for the current network.

Source code

function wp_update_network_counts() {

	global $wpdb;



	$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) );

	update_site_option( 'blog_count', $count );



	$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'") );

	update_site_option( 'user_count', $count );

}

11041