Академический Документы
Профессиональный Документы
Культура Документы
8
See the original page on: http://codex.wordpress.org/Version_2.8
On May xxth, 2009, WordPress Version 2.8, named for xxxxxxxxxxxxxxx, will be released to the public. For
more information on this enhancement and bug-fix release, read the Development Blog and see the
Changelog for 2.8.
New Features
User Features
Advanced Features
JS script loader Improvements
jQuery 1.3.2
Improvements to the script loader: allows plugins to queue scripts for the front end head and
footer, adds hooks for server side caching of compressed scripts, adds support for ENFORCE_GZIP
constant (deflate is used by default since it's faster)
Load the minified versions of the scripts by default, define('SCRIPT_DEBUG', true); can be used to
load the development versions
Remove events from categories chechboxes in quick edit to speed up page unload
Make simple form validation and ajax-add new categories compatible with jQuery 1.3.1
Load farbtastic.js has to be loaded in the head
Note: see Lester Chan's Loading Javascript in Footer blog and Andrew Ozz's Script Loader Updates
blog
New Widgets API
WP_Widget is a class that abstracts away much of the complexity involved in writing a widget, especially
multi-widgets.
Basically, you extend WP_Widget with your own class that provides a constructor and three
methods -- widget(), form(), and update().
o widget() - outputs the actual content of the widget.
o update() - processes options to be saved.
o form() - outputs the options form.
A widget is registered by passing the name of the widget class to register_widget().
All widgets written with WP_Widget are multiple instance capable.
Options
o Options for old single-instance widgets ported to WP_Widget will be upgraded to the new
multi-option storage format, which is simply a multi-dimensional array keyed by instance ID.
o Options for widgets using the old multi-instance pattern should work as is.
o If your widget has custom option storage needs, you can provide your own get_settings()
and save_settings() methods.
The WP_Widget source can be viewed here (read the phpdoc for moreinfo on usage):
http://core.trac.wordpress.org/browser/trunk/wp-includes/widgets.php
You can see examples of how to use it here: http://core.trac.wordpress.org/browser/trunk/wp-
includes/default-widgets.php
If you author any widgets, try porting them to WP_Widget and give your feedback on what can be
improved an Trac Ticket 8441.
Props to the MultiWidget class, on which WP_Widget is based:
http://blog.firetree.net/2008/11/30/wordpress-multi-widget/
The above extracted from Ryan Boren's wp-hackers post.
Example plugin demonstrates menus with Dashboard, Posts, and Comments in the first menu
group. The remaining menus follow in their usual order.
When filtering the order array, any menus that are not mentioned in the array will be sorted after
ones that are mentioned.
Unmentioned menus are sorted in their usual order, relative to other unmentioned menus.
Information extracted from Ryan Boren's comments on Trac Ticket 9652