WordPress 3.0Andrew NacinWordPress Core Developertwitter @nacinweb andrewnacin.comemail andrewnacin@gmail.com
Make sure WP_CACHE is true. Props nacin.
PHP 5.22011 Q2WordPress 3.2
In nine weeks,WordPress 3.0was downloaded12,654,147 timeshttp://wordpress.org/download/counter/
WordPresspowers8.5 percent of the webAcquia
WordPressis a CMS
Custompost typesCustomtaxonomiesTheme developmentThe mergeof WPMUWhy WordPress is a CMS3.0
Custompost typesCustomtaxonomiesTheme developmentThe mergeof WPMUWhy WordPress is a CMS
blogsite
a post type isacontent type
What can post types be used for?Everything.
Core post typesPostsPagesAttachmentsRevisionsMenu Items
They are your content and storage.BlogArticlesNews ReleasesPortfolioProductsNewsletterEventsTweetsEmployeesMy Reading ListDocumentationForumsMenu ItemsUploadsLoggingRevisions
Why?Some use cases are obvious.Articles, Newsletters, Portfolio, EventsSome are not.Logging, Menu items
Leverage what WordPressdoes bestPerformanceNo direct queriesUtilize cachingExtremely lightScalabilityEaseFull APIFull admin UIUse existing featuresWhy reinvent the wheel?
Leverage existing featuresWhat can posts have?Title, content, excerptAuthorCategories, tagsRevisionsComments, PingbacksThumbnailsAttachmentsCustom fields (meta)What can you leverage?TemplatingURL RewritingWP_QueryCapabilitiesAdmin UI, meta boxesFeeds
Let’s put it togetheradd_action( 'init', 'my_employees_init' );function my_employees_init() {register_post_type( 'my_employee', array('labels' => array('name'          => 'Employees','singular_name' => 'Employee' ),'public'       => true,'show_ui'      => true,'rewrite'      => array( 'slug' => 'team' ),'query_var'    => 'team','hierarchical' => false,'supports' => array(			'title', 'thumbnail', 'editor', 'excerpt' ),	) );}
What’s it look like?
Editing me
Let’s create a quick templatequery_posts( array('post_type' => 'my_employee') );if ( have_posts() ) :while ( have_posts() ) :the_post();echo '<h2><a href="' . get_permalink() . '">' .get_the_title() . '</a></h2>';the_post_thumbnail();the_content();echo '<p>Read posts by ';the_author_posts_link();echo '</p>';endwhile; endif;
Done./team//team/andrew-nacin//blog/author/andrew-nacin/(excuse my CSS)
Custom taxonomiesdescribe your content.
Core taxonomiesPost TagsCategoriesLink CategoriesMenus
They describe your content.The difference between tags and categories is hierarchy.TopicsPeopleCitiesCitiesContent: Travel blogCuisineContent: RestaurantsSongsContent: ConcertsActors, Directors, ProducersContent: Movies
Custom taxonomies are not newDatabase schema — WP 2.3, Sept. 2007Custom taxonomies — WP 2.5, March 2008Partial UI — WP 2.8, June 2009In WP 3.0 — full custom UI implementationSo basically, they’re now on steroids.
Specialties taxonomyregister_taxonomy( 'my_specialties', 'nacin_employee', array('labels' => array('name'          => 'Specialties', 		'singular_name' => 'Specialty' ),'public'       => true,'show_ui'      => true,'query_var'    => false,'rewrite'      => false,'hierarchical' => false,) );
Edit screen
'hierarchical' => 'false'
'hierarchical' => 'true'
WordPress 3.0 makestheme development and customizations easier.
Admin UI screenshot
How?In our themefunctions.php:function my_theme_setup() {add_custom_background();}add_action( 'after_setup_theme', 'my_theme_setup' );1234
function my_theme_setup() {add_custom_background();define( 'NO_HEADER_TEXT', true );define( 'HEADER_IMAGE_WIDTH', 940 );define( 'HEADER_IMAGE_HEIGHT', 198 );define( 'HEADER_IMAGE', '%s/images/default.jpg' );add_custom_header( 'my_theme_header_style', 	'my_theme_admin_header_style' );register_default_header( array(		'default' => array(			'url' => '%s/images/default.jpg',			'thumbnail_url' => '%s/images/default-thumb.jpg','description' => 'Default Header' ),		) );}add_action( 'after_setup_theme', 'my_theme_setup' );2345678910111213
Custom Header, cont.function my_theme_admin_header_style() {echo '#headimg { height: ' .     HEADER_IMAGE_HEIGHT . 'px; width: ' .     HEADER_IMAGE_WIDTH . 'px; }';}function my_theme_header_style() {echo '#header { background-image: url(' .    header_image() . '); }';}123456
MenusScreenshot of menu admin
In our themefunctions.php:function my_theme_setup() {add_custom_background();add_custom_header( 'my_theme_header_style', 	'my_theme_admin_header_style' );	// ...register_nav_menu('header', 'Primary Navigation');}add_action( 'after_setup_theme', 'my_theme_setup' );In our theme header.php:wp_nav_menu( array( 'theme_location' => 'header' ) );1234567
MenusScreenshot of menus in Twenty Ten
Evolving Theme Developmentget_template_part()It’s basicallyinclude()on steroids.Example:get_template_part('loop', 'archive');Process:Check for loop-archive.php. Check the child theme first, if applicable.Otherwise, check for loop.php.Less Redundancy FTW.
get_template_part('header', 'home');Is like calling:get_header( 'home' );Same deal: header-home.php,then header.php.
What’s with thetheme improvements?In 3.0, we weretheme developers.
Kubrick!
Twenty Ten
Power one site or 10 million.
WordPress MultisiteThe WPMU fork was mergedMassive merge sprint, followed by cleanupTerminology/concept nightmareTODO: Network admin UI improvementsTODO: Easier to manage, use, and install (in that order
Oh no, please don’t.define( 'WP_ALLOW_MULTISITE', true );
Only if you insist.
A new Network AdminNew MU screen
Other cool featuresPick a username/password during installcomment_form() and wp_login_form()Stronger authentication security by defaultBulk update plugins and themes“Search Engines Blocked”Rewritten initialization code
Follow along#wordpress-dev on freenode.nethttp://wpdevel.wordpress.comhttp://core.trac.wordpress.orgwp-svn– mailing list for commitswp-hackers – plugin and core developerswp-testers
What might be nextColumn sorting and a more AJAX feelMore features for custom post types and custom taxonomiesSupport for custom comment typesBetter support for custom post statusesMedia/upload overhaulIncremental admin, DRY, UX changesIncremental improvements to multisiteLinks as a post typeRoles/capabilities overhaul
Our philosophies.codex.wordpress.org/Release_Philosophy
Decisions, not options.
Preferences have a cost.Too many means you can't find any of them.They damage QA and testing.They make good UI difficult.They confuse users.Do something specific and do it well.Defaults that work will lead the UI in the right direction.
The quality of an interface design is inversely proportional to the number of designers.
If you're too lazy to do the homework and think through the big-picture rationale, I'm too lazy to add the feature.
In the presence of good rationale, maintainers should be willing to change their mind often.
Let’s talk           security.
QualysBlindElephantBlindElephantis a web application fingerprinter.Drupal, Joomla!, Liferay, Mediawiki, Moodle, MovableType, osCommerce, phpBB, phpMyAdmin, phpNuke, SPIP, WordPress
96 percentJOOMLA 1.5.20Versions < 1.0.15 and < 1.5.17 are critically insecure. Version 1.5.17 was released 3 months ago.Percentage of installs running a critically insecure version?
69 percent (and up)DRUPAL 6.19Versions < 5.22 and < 6.16 are critically insecure. Version 6.16 was released in March. Versions 6.18 and 5.23 were critical security fixes released last week.Percentage of installs running a critically insecure version?
4 percentWORDPRESS 3.0.1Versions < 2.5.1 are critically insecure. (Released in April 2008.)Versions < 2.8.3 are insecure. (August 2009.)Percentage of installs running a critically insecure version?
Shared hosts suck.
security@wordpress.org
pre-release candidates for 3.0 were downloaded 75,000timesQUALITY ASSURANCE
Questions?twitter @nacinweb andrewnacin.comemail andrewnacin@gmail.com

WordPress 3.0 at DC PHP