-

← %s', 'twentyten' ), get_the_title( $post->post_parent ) ); - ?>

+ post_parent ) ) : ?> +

← %s', 'twentyten' ), get_the_title( $post->post_parent ) ); + ?>

+
>

diff --git a/wp-content/themes/twentyten/editor-style.css b/wp-content/themes/twentyten/editor-style.css index fa875cad..31ea0d5b 100644 --- a/wp-content/themes/twentyten/editor-style.css +++ b/wp-content/themes/twentyten/editor-style.css @@ -39,7 +39,7 @@ body, input, textarea { line-height: 18px; } hr { - background-color: #E7E7E7; + background-color: #e7e7e7; border:0; height: 1px; margin-bottom: 18px; @@ -95,7 +95,7 @@ big { font-size: 131.25%; } ins { - background: #FFFFCC; + background: #ffffcc; border: none; color: #333; } @@ -142,14 +142,14 @@ sub { top: .5ex; } a:link { - color:#0066CC; + color:#0066cc; } a:visited { color:#743399; } a:active, a:hover { - color: #FF4B33; + color: #ff4b33; } p, ul, diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 3a61e9d8..d7a127a2 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -203,64 +203,6 @@ function twentyten_admin_header_style() { } endif; -/** - * Makes some changes to the tag, by filtering the output of wp_title(). - * - * If we have a site description and we're viewing the home page or a blog posts - * page (when using a static front page), then we will add the site description. - * - * If we're viewing a search result, then we're going to recreate the title entirely. - * We're going to add page numbers to all titles as well, to the middle of a search - * result title and the end of all other titles. - * - * The site title also gets added to all titles. - * - * @since Twenty Ten 1.0 - * - * @param string $title Title generated by wp_title() - * @param string $separator The separator passed to wp_title(). Twenty Ten uses a - * vertical bar, "|", as a separator in header.php. - * @return string The new title, ready for the <title> tag. - */ -function twentyten_filter_wp_title( $title, $separator ) { - // Don't affect wp_title() calls in feeds. - if ( is_feed() ) - return $title; - - // The $paged global variable contains the page number of a listing of posts. - // The $page global variable contains the page number of a single post that is paged. - // We'll display whichever one applies, if we're not looking at the first page. - global $paged, $page; - - if ( is_search() ) { - // If we're a search, let's start over: - $title = sprintf( __( 'Search results for %s', 'twentyten' ), '"' . get_search_query() . '"' ); - // Add a page number if we're on page 2 or more: - if ( $paged >= 2 ) - $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), $paged ); - // Add the site name to the end: - $title .= " $separator " . get_bloginfo( 'name', 'display' ); - // We're done. Let's send the new title back to wp_title(): - return $title; - } - - // Otherwise, let's start by adding the site name to the end: - $title .= get_bloginfo( 'name', 'display' ); - - // If we have a site description and we're on the home/front page, add the description: - $site_description = get_bloginfo( 'description', 'display' ); - if ( $site_description && ( is_home() || is_front_page() ) ) - $title .= " $separator " . $site_description; - - // Add a page number if necessary: - if ( $paged >= 2 || $page >= 2 ) - $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); - - // Return the new title to wp_title(): - return $title; -} -add_filter( 'wp_title', 'twentyten_filter_wp_title', 10, 2 ); - /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. * diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index fbd24860..fa4b7279 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -15,11 +15,23 @@ <title><?php /* * Print the <title> tag based on what is being viewed. - * We filter the output of wp_title() a bit -- see - * twentyten_filter_wp_title() in functions.php. */ + global $page, $paged; + wp_title( '|', true, 'right' ); + // Add the blog name. + bloginfo( 'name' ); + + // Add the blog description for the home/front page. + $site_description = get_bloginfo( 'description', 'display' ); + if ( $site_description && ( is_home() || is_front_page() ) ) + echo " | $site_description"; + + // Add a page number if necessary: + if ( $paged >= 2 || $page >= 2 ) + echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); + ?> diff --git a/wp-content/themes/twentyten/languages/twentyten.pot b/wp-content/themes/twentyten/languages/twentyten.pot index b8985cf5..f3bfcd23 100644 --- a/wp-content/themes/twentyten/languages/twentyten.pot +++ b/wp-content/themes/twentyten/languages/twentyten.pot @@ -1,4 +1,4 @@ -# Translation of the WordPress theme Twenty Ten 1.0 by the WordPress team. +# Translation of the WordPress theme Twenty Ten 1.1 by the WordPress team. # Copyright (C) 2010 the WordPress team # This file is distributed under the same license as the Twenty Ten package. # FIRST AUTHOR , 2010. @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Twenty Ten 1.0\n" +"Project-Id-Version: Twenty Ten 1.1\n" "Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n" -"POT-Creation-Date: 2010-06-15 16:21+0000\n" +"POT-Creation-Date: 2010-07-14 16:21+0000\n" "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -46,51 +46,51 @@ msgstr "" msgid "Blog Archives" msgstr "" -#: attachment.php:17 +#: attachment.php:18 #, php-format msgid "Return to %s" msgstr "" #. translators: %s - title of parent post -#: attachment.php:19 +#: attachment.php:20 #, php-format msgid " %s" msgstr "" -#: attachment.php:27 +#: attachment.php:29 #, php-format msgid "By %2$s" msgstr "" -#: attachment.php:31 functions.php:509 +#: attachment.php:33 functions.php:451 #, php-format msgid "View all posts by %s" msgstr "" -#: attachment.php:38 +#: attachment.php:40 #, php-format msgid "Published %2$s" msgstr "" -#: attachment.php:48 +#: attachment.php:50 #, php-format msgid "Full size is %s pixels" msgstr "" -#: attachment.php:51 +#: attachment.php:53 msgid "Link to full-size image" msgstr "" -#: attachment.php:58 attachment.php:105 loop.php:94 loop.php:117 loop.php:159 +#: attachment.php:60 attachment.php:107 loop.php:95 loop.php:118 loop.php:160 #: onecolumn-page.php:27 page.php:32 single.php:53 msgid "Edit" msgstr "" -#: attachment.php:98 functions.php:299 loop.php:109 loop.php:137 +#: attachment.php:100 functions.php:241 loop.php:110 loop.php:138 msgid "Continue reading " msgstr "" -#: attachment.php:99 loop.php:138 onecolumn-page.php:26 page.php:31 +#: attachment.php:101 loop.php:139 onecolumn-page.php:26 page.php:31 #: single.php:31 msgid "Pages:" msgstr "" @@ -134,7 +134,7 @@ msgstr "" msgid "Comments are closed." msgstr "" -#. #-#-#-#-# twentyten.pot (Twenty Ten 1.0) #-#-#-#-# +#. #-#-#-#-# twentyten.pot (Twenty Ten 1.1) #-#-#-#-# #. Theme URI of the plugin/theme #: footer.php:33 msgid "http://wordpress.org/" @@ -193,124 +193,119 @@ msgstr "" msgid "Sunset" msgstr "" -#: functions.php:237 -#, php-format -msgid "Search results for %s" -msgstr "" - -#: functions.php:240 functions.php:257 -#, php-format -msgid "Page %s" -msgstr "" - -#: functions.php:366 +#: functions.php:308 #, php-format msgid "%s says:" msgstr "" -#: functions.php:369 +#: functions.php:311 msgid "Your comment is awaiting moderation." msgstr "" #. translators: 1: date, 2: time -#: functions.php:376 +#: functions.php:318 #, php-format msgid "%1$s at %2$s" msgstr "" -#: functions.php:376 functions.php:393 +#: functions.php:318 functions.php:335 msgid "(Edit)" msgstr "" -#: functions.php:393 +#: functions.php:335 msgid "Pingback:" msgstr "" -#: functions.php:412 +#: functions.php:354 msgid "Primary Widget Area" msgstr "" -#: functions.php:414 +#: functions.php:356 msgid "The primary widget area" msgstr "" -#: functions.php:423 +#: functions.php:365 msgid "Secondary Widget Area" msgstr "" -#: functions.php:425 +#: functions.php:367 msgid "The secondary widget area" msgstr "" -#: functions.php:434 +#: functions.php:376 msgid "First Footer Widget Area" msgstr "" -#: functions.php:436 +#: functions.php:378 msgid "The first footer widget area" msgstr "" -#: functions.php:445 +#: functions.php:387 msgid "Second Footer Widget Area" msgstr "" -#: functions.php:447 +#: functions.php:389 msgid "The second footer widget area" msgstr "" -#: functions.php:456 +#: functions.php:398 msgid "Third Footer Widget Area" msgstr "" -#: functions.php:458 +#: functions.php:400 msgid "The third footer widget area" msgstr "" -#: functions.php:467 +#: functions.php:409 msgid "Fourth Footer Widget Area" msgstr "" -#: functions.php:469 +#: functions.php:411 msgid "The fourth footer widget area" msgstr "" -#: functions.php:500 +#: functions.php:442 #, php-format msgid "" "Posted on %2$s by %3$s" msgstr "" -#: functions.php:526 +#: functions.php:468 #, php-format msgid "" "This entry was posted in %1$s and tagged %2$s. Bookmark the permalink." msgstr "" -#: functions.php:528 +#: functions.php:470 #, php-format msgid "" "This entry was posted in %1$s. Bookmark the permalink." msgstr "" -#: functions.php:530 +#: functions.php:472 #, php-format msgid "" "Bookmark the permalink." msgstr "" -#: header.php:71 +#: header.php:33 +#, php-format +msgid "Page %s" +msgstr "" + +#: header.php:83 msgid "Skip to content" msgstr "" -#: loop.php:25 loop.php:172 +#: loop.php:25 loop.php:173 msgid " Older posts" msgstr "" -#: loop.php:26 loop.php:173 +#: loop.php:26 loop.php:174 msgid "Newer posts " msgstr "" @@ -320,52 +315,52 @@ msgid "" "searching will help find a related post." msgstr "" -#: loop.php:60 loop.php:91 +#: loop.php:60 loop.php:92 msgctxt "gallery category slug" msgid "gallery" msgstr "" -#: loop.php:62 loop.php:82 loop.php:125 +#: loop.php:62 loop.php:83 loop.php:126 #, php-format msgid "Permalink to %s" msgstr "" -#: loop.php:81 +#: loop.php:82 #, php-format msgid "This gallery contains %2$s photos." msgstr "" -#: loop.php:91 +#: loop.php:92 msgid "View posts in the Gallery category" msgstr "" -#: loop.php:91 +#: loop.php:92 msgid "More Galleries" msgstr "" -#: loop.php:93 loop.php:116 loop.php:158 +#: loop.php:94 loop.php:117 loop.php:159 msgid "Leave a comment" msgstr "" -#: loop.php:93 loop.php:116 loop.php:158 +#: loop.php:94 loop.php:117 loop.php:159 msgid "1 Comment" msgstr "" -#: loop.php:93 loop.php:116 loop.php:158 +#: loop.php:94 loop.php:117 loop.php:159 msgid "% Comments" msgstr "" -#: loop.php:100 +#: loop.php:101 msgctxt "asides category slug" msgid "asides" msgstr "" -#: loop.php:145 +#: loop.php:146 #, php-format msgid "Posted in %2$s" msgstr "" -#: loop.php:154 +#: loop.php:155 #, php-format msgid "Tagged %2$s" msgstr "" @@ -418,7 +413,15 @@ msgid "Twenty Ten" msgstr "" #. Description of the plugin/theme -msgid "The 2010 default theme for WordPress." +msgid "" +"The 2010 theme for WordPress is stylish, customizable, simple, and readable " +"-- make it yours with a custom menu, header image, and background. Twenty " +"Ten supports six widgetized areas (two in the sidebar, four in the footer) " +"and featured images (thumbnails for gallery posts and custom header images " +"for posts and pages). It includes stylesheets for print and the admin Visual " +"Editor, special styles for posts in the \"Asides\" and \"Gallery\" " +"categories, and has an optional one-column page template that removes the " +"sidebar." msgstr "" #. Author of the plugin/theme diff --git a/wp-content/themes/twentyten/loop.php b/wp-content/themes/twentyten/loop.php index 84c167dc..c0d746f3 100644 --- a/wp-content/themes/twentyten/loop.php +++ b/wp-content/themes/twentyten/loop.php @@ -68,22 +68,23 @@
- - -

%2$s photos.', 'twentyten' ), - 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', - $total_images - ); ?>

- - + + $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); + if ( $images ) : + $total_images = count( $images ); + $image = array_shift( $images ); + $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); + ?> + +

%2$s photos.', 'twentyten' ), + 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', + $total_images + ); ?>

+ +
diff --git a/wp-content/themes/twentyten/page.php b/wp-content/themes/twentyten/page.php index 540767c5..a6081c80 100644 --- a/wp-content/themes/twentyten/page.php +++ b/wp-content/themes/twentyten/page.php @@ -3,8 +3,8 @@ * The template for displaying all pages. * * This is the template that displays all pages by default. - * Please note that this is the wordpress construct of pages - * and that other 'pages' on your wordpress site will use a + * Please note that this is the WordPress construct of pages + * and that other 'pages' on your WordPress site will use a * different template. * * @package WordPress @@ -22,9 +22,9 @@ get_header(); ?>
>

- +

- +
diff --git a/wp-content/themes/twentyten/style.css b/wp-content/themes/twentyten/style.css index 71a129e7..5dbf6317 100644 --- a/wp-content/themes/twentyten/style.css +++ b/wp-content/themes/twentyten/style.css @@ -1,14 +1,14 @@ /* Theme Name: Twenty Ten Theme URI: http://wordpress.org/ -Description: The 2010 default theme for WordPress. +Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar. Author: the WordPress team -Version: 1.0 +Version: 1.1 Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style */ -/* Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html +/* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html -------------------------------------------------------------- */ html, body, div, span, applet, object, iframe, @@ -20,18 +20,18 @@ b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { + background: transparent; + border: 0; margin: 0; padding: 0; - border: 0; vertical-align: baseline; - background: transparent; } body { line-height: 1; } h1, h2, h3, h4, h5, h6 { - font-weight: normal; clear: both; + font-weight: normal; } ol, ul { list-style: none; @@ -51,9 +51,12 @@ table { border-collapse: collapse; border-spacing: 0; } -a img { border: none; } - +a img { + border: none; +} +/* =Layout +-------------------------------------------------------------- */ /* LAYOUT: Two columns @@ -112,7 +115,6 @@ textarea, .pingback a.url { font-family: Georgia, "Bitstream Charter", serif; } - h3#comments-title, h3#reply-title, #access .menu, @@ -138,8 +140,7 @@ h3#reply-title, .reply, .widget-title, .wp-caption-text, -input[type=submit] -{ +input[type=submit] { font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; } pre { @@ -150,7 +151,6 @@ code { } - /* =Structure -------------------------------------------------------------- */ @@ -165,8 +165,8 @@ div.menu, width: 940px; } #wrapper { - margin-top: 20px; background: #fff; + margin-top: 20px; padding: 0 20px; } @@ -184,9 +184,9 @@ div.menu, } #site-info { float: left; - width: 700px; - font-weight: bold; font-size: 14px; + font-weight: bold; + width: 700px; } #site-generator { float: right; @@ -194,15 +194,13 @@ div.menu, } - /* =Global Elements -------------------------------------------------------------- */ -/* Main global 'theme' and typographic styles */ +/* Main global 'theme' and typographic styles */ body { background: #f1f1f1; } - body, input, textarea { @@ -211,11 +209,11 @@ textarea { line-height: 18px; } hr { - background-color: #E7E7E7; - border:0; + background-color: #e7e7e7; + border: 0; + clear: both; height: 1px; margin-bottom: 18px; - clear:both; } /* Text elements */ @@ -231,22 +229,22 @@ ol { margin: 0 0 18px 1.5em; } ol ol { - list-style:upper-alpha; + list-style: upper-alpha; } ol ol ol { - list-style:lower-roman; + list-style: lower-roman; } ol ol ol ol { - list-style:lower-alpha; + list-style: lower-alpha; } ul ul, ol ol, ul ol, ol ul { - margin-bottom:0; + margin-bottom: 0; } dl { - margin:0 0 24px 0; + margin: 0 0 24px 0; } dt { font-weight: bold; @@ -290,13 +288,12 @@ acronym { border-bottom: 1px dotted #666; cursor: help; } - sup, sub { height: 0; line-height: 1; - vertical-align: baseline; position: relative; + vertical-align: baseline; } sup { bottom: 1ex; @@ -306,22 +303,22 @@ sub { } input[type="text"], textarea { - padding: 2px; background: #f9f9f9; border: 1px solid #ccc; box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); + padding: 2px; } a:link { - color:#0066CC; + color: #0066cc; } a:visited { - color:#743399; + color: #743399; } a:active, a:hover { - color: #FF4B33; + color: #ff4b33; } /* Text meant only for screen readers */ @@ -331,7 +328,6 @@ a:hover { } - /* =Header -------------------------------------------------------------- */ @@ -340,10 +336,10 @@ a:hover { } #site-title { float: left; - margin: 0 0 18px 0; - width: 700px; font-size: 30px; line-height: 36px; + margin: 0 0 18px 0; + width: 700px; } #site-title a { color: #000; @@ -360,28 +356,28 @@ a:hover { /* This is the custom header image */ #branding img { - clear: both; border-top: 4px solid #000; - display: block; border-bottom: 1px solid #000; + clear: both; + display: block; } - /* =Menu -------------------------------------------------------------- */ #access { background: #000; + display: block; + float: left; margin: 0 auto; width: 940px; - display:block; - float:left; } #access .menu-header, div.menu { font-size: 13px; margin-left: 12px; + width: 928px; } #access .menu-header ul, div.menu ul { @@ -390,49 +386,49 @@ div.menu ul { } #access .menu-header li, div.menu li { - float:left; + float: left; position: relative; } #access a { - display:block; - text-decoration:none; - color:#aaa; - padding:0 10px; - line-height:38px; + color: #aaa; + display: block; + line-height: 38px; + padding: 0 10px; + text-decoration: none; } #access ul ul { - display:none; - position:absolute; - top:38px; - left:0; - float:left; box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); + display: none; + position: absolute; + top: 38px; + left: 0; + float: left; width: 180px; z-index: 99999; } #access ul ul li { - min-width: 180px; + min-width: 180px; } #access ul ul ul { - left:100%; - top:0; + left: 100%; + top: 0; } #access ul ul a { - background:#333; - height:auto; - line-height:1em; - padding:10px; + background: #333; + line-height: 1em; + padding: 10px; width: 160px; + height: auto; } #access li:hover > a, #access ul ul :hover > a { - color:#fff; - background:#333; + background: #333; + color: #fff; } #access ul li:hover > ul { - display:block; + display: block; } #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, @@ -440,19 +436,20 @@ div.menu li { #access ul li.current-menu-parent > a { color: #fff; } - * html #access ul li.current_page_item a, * html #access ul li.current-menu-ancestor a, * html #access ul li.current-menu-item a, * html #access ul li.current-menu-parent a, * html #access ul li a:hover { - color:#fff; + color: #fff; } + /* =Content -------------------------------------------------------------- */ #main { + clear: both; overflow: hidden; padding: 40px 0 0 0; } @@ -472,13 +469,13 @@ div.menu li { #content dd, #content pre, #content hr { - margin-bottom:24px; + margin-bottom: 24px; } #content ul ul, #content ol ol, #content ul ol, #content ol ul { - margin-bottom:0; + margin-bottom: 0; } #content pre, #content kbd, @@ -501,13 +498,13 @@ div.menu li { #content h5, #content h6 { color: #000; - margin: 0 0 20px 0; line-height: 1.5em; + margin: 0 0 20px 0; } #content table { border: 1px solid #e7e7e7; - text-align: left; margin: 0 -1px 24px 0; + text-align: left; width: 100%; } #content tr th, @@ -523,17 +520,17 @@ div.menu li { padding: 6px 24px; } #content tr.odd td { - background: #F2F7FC; + background: #f2f7fc; } .hentry { margin: 0 0 48px 0; } .home .sticky { - background: #F2F7FC; + background: #f2f7fc; border-top: 4px solid #000; - padding: 18px 20px; margin-left: -20px; margin-right: -20px; + padding: 18px 20px; } .single .hentry { margin: 0 0 36px 0; @@ -552,28 +549,28 @@ div.menu li { } .page-title a:link, .page-title a:visited { - color:#888; + color: #888; text-decoration: none; } .page-title a:active, .page-title a:hover { - color: #FF4B33; + color: #ff4b33; } #content .entry-title { color: #000; font-size: 21px; - line-height: 1.3em; font-weight: bold; + line-height: 1.3em; margin-bottom: 0; } .entry-title a:link, .entry-title a:visited { - color:#000; + color: #000; text-decoration: none; } .entry-title a:active, .entry-title a:hover { - color: #FF4B33; + color: #ff4b33; } .entry-meta { color: #888; @@ -596,7 +593,7 @@ div.menu li { margin-bottom: 12px; } .entry-content fieldset { - border: 1px solid #E7E7E7; + border: 1px solid #e7e7e7; margin: 0 0 24px 0; padding: 24px; } @@ -640,46 +637,46 @@ div.menu li { } .page-link { color: #000; - font-weight:bold; - margin:0 0 22px 0; - word-spacing:0.5em; + font-weight: bold; + margin: 0 0 22px 0; + word-spacing: 0.5em; } .page-link a:link, .page-link a:visited { background: #f1f1f1; - color:#333; - font-weight:normal; - padding:0.5em 0.75em; - text-decoration:none; + color: #333; + font-weight: normal; + padding: 0.5em 0.75em; + text-decoration: none; } .home .sticky .page-link a { - background: #D9E8F7; + background: #d9e8f7; } .page-link a:active, .page-link a:hover { - color: #FF4B33; + color: #ff4b33; } -.page .edit-link { +body.page .edit-link { clear: both; display: block; } #entry-author-info { - background: #F2F7FC; + background: #f2f7fc; border-top: 4px solid #000; - padding: 18px 20px; - margin: 24px 0; - overflow: hidden; clear: both; font-size: 14px; line-height: 20px; + margin: 24px 0; + overflow: hidden; + padding: 18px 20px; } #entry-author-info #author-avatar { background: #fff; border: 1px solid #e7e7e7; float: left; + height: 60px; margin: 0 -104px 0 0; padding: 11px; - height: 60px; } #entry-author-info #author-description { float: left; @@ -687,15 +684,15 @@ div.menu li { } #entry-author-info h2 { color: #000; - font-weight: bold; font-size: 100%; + font-weight: bold; margin-bottom: 0; } .entry-utility { + clear: both; color: #888; font-size: 12px; line-height: 18px; - clear: both; } .entry-meta a, .entry-utility a { @@ -703,22 +700,21 @@ div.menu li { } .entry-meta a:hover, .entry-utility a:hover { - color: #FF4B33; + color: #ff4b33; } #content .video-player { padding: 0; } - -/* Asides +/* =Asides -------------------------------------------------------------- */ .home #content .category-asides p { font-size: 14px; line-height: 20px; margin-bottom: 10px; - margin-top:0; + margin-top: 0; } .home .hentry.category-asides { padding: 0; @@ -728,42 +724,26 @@ div.menu li { } - - -/* Gallery listing +/* =Gallery listing -------------------------------------------------------------- */ -.category-gallery { - margin-bottom: 48px; -} -.category-gallery h2 { - margin-top: 10px; -} -.category-gallery .entry-meta { -} .category-gallery .size-thumbnail img { border: 10px solid #f1f1f1; margin-bottom: 0; } .category-gallery .gallery-thumb { float: left; - margin-right:20px; + margin-right: 20px; margin-top: -4px; } -.home #content .category-gallery .entry-content p { - display: inline; -} .home #content .category-gallery .entry-utility { - padding-top:4px; + padding-top: 4px; } -/* Attachment pages +/* =Attachment pages -------------------------------------------------------------- */ -.entry-content .attachment img { - margin-bottom: 0; -} .attachment .entry-content .entry-caption { font-size: 140%; margin-top: 24px; @@ -776,13 +756,14 @@ div.menu li { } - -/* Images +/* =Images -------------------------------------------------------------- */ #content img { margin: 0; + height: auto; max-width: 640px; + width: auto; } #content .attachment img { max-width: 900px; @@ -808,31 +789,31 @@ div.menu li { margin-left: auto; margin-right: auto; } -#content img.alignleft, -#content img.alignright, +#content img.alignleft, +#content img.alignright, #content img.aligncenter { margin-bottom: 12px; } #content .wp-caption { background: #f1f1f1; line-height: 18px; - text-align: center; margin-bottom: 20px; padding: 4px; + text-align: center; } #content .wp-caption img { margin: 5px 5px 0; } #content .wp-caption p.wp-caption-text { - margin: 5px; color: #888; font-size: 12px; + margin: 5px; } #content .wp-smiley { - margin:0; + margin: 0; } #content .gallery { - margin: auto; + margin: 0 auto 18px; } #content .gallery .gallery-item { float: left; @@ -857,17 +838,20 @@ div.menu li { #content .gallery br+br { display: none; } - +#content .attachment img { /* single attachment images should be centered */ + display: block; + margin: 0 auto; +} /* =Navigation -------------------------------------------------------------- */ .navigation { - font-size: 12px; + color: #888; + font-size: 12px; line-height: 18px; overflow: hidden; - color: #888; } .navigation a:link, .navigation a:visited { @@ -876,7 +860,7 @@ div.menu li { } .navigation a:active, .navigation a:hover { - color: #FF4B33; + color: #ff4b33; } .nav-previous { float: left; @@ -884,8 +868,8 @@ div.menu li { } .nav-next { float: right; + text-align: right; width: 50%; - text-align:right; } #nav-above { margin: 0 0 18px 0; @@ -902,7 +886,6 @@ div.menu li { } - /* =Comments -------------------------------------------------------------- */ #comments { @@ -914,8 +897,8 @@ div.menu li { h3#comments-title, h3#reply-title { color: #000; - font-weight: bold; font-size: 20px; + font-weight: bold; margin-bottom: 0; } h3#comments-title { @@ -933,8 +916,8 @@ h3#comments-title { position: relative; } .commentlist li:last-child { - border-bottom:none; - margin-bottom:0; + border-bottom: none; + margin-bottom: 0; } #comments .comment-body ul, #comments .comment-body ol { @@ -975,7 +958,7 @@ h3#comments-title { } .comment-meta a:active, .comment-meta a:hover { - color: #FF4B33; + color: #ff4b33; } .commentlist .even { } @@ -991,7 +974,7 @@ a.comment-edit-link { } .reply a:hover, a.comment-edit-link:hover { - color: #FF4B33; + color: #ff4b33; } .commentlist .children { list-style: none; @@ -1006,34 +989,32 @@ a.comment-edit-link:hover { display: none; } #comments .pingback { + border-bottom: 1px solid #e7e7e7; margin-bottom: 18px; padding-bottom: 18px; - border-bottom: 1px solid #e7e7e7; } .commentlist li.comment+li.pingback { margin-top: -6px; } #comments .pingback p { color: #888; + display: block; font-size: 12px; line-height: 18px; - display:block; margin: 0; } #comments .pingback .url { - font-style: italic; font-size: 13px; + font-style: italic; } - - /* Comments form */ input[type=submit] { color: #333; } #respond { - margin: 24px 0; border-top: 1px solid #e7e7e7; + margin: 24px 0; overflow: hidden; position: relative; } @@ -1060,23 +1041,23 @@ h3#reply-title { } #cancel-comment-reply-link { font-size: 12px; - line-height: 18px; font-weight: normal; + line-height: 18px; } #respond .required { - color:#FF4B33; - font-weight:bold; + color: #ff4b33; + font-weight: bold; } #respond label { color: #888; font-size: 12px; } #respond input { - margin:0 0 9px; - width:98%; + margin: 0 0 9px; + width: 98%; } #respond textarea { - width:98%; + width: 98%; } #respond .form-allowed-tags { color: #888; @@ -1090,8 +1071,8 @@ h3#reply-title { margin: 12px 0; } #respond .form-submit input { - width: auto; font-size: 14px; + width: auto; } @@ -1106,11 +1087,11 @@ h3#reply-title { list-style: square; margin-left: 1.3em; } -.widget_search #s { /* This keeps the search inputs in line */ +.widget_search #s {/* This keeps the search inputs in line */ width: 60%; } .widget_search label { - display:none; + display: none; } .widget-container { margin: 0 0 18px 0; @@ -1134,17 +1115,17 @@ h3#reply-title { line-height: 1.6em; } #wp-calendar { - width:100%; + width: 100%; } #wp-calendar caption { - font-weight: bold; color: #222; - text-align: left; - font-size:14px; + font-size: 14px; + font-weight: bold; padding-bottom: 4px; + text-align: left; } #wp-calendar thead { - font-size:11px; + font-size: 11px; } #wp-calendar thead th { } @@ -1152,9 +1133,9 @@ h3#reply-title { color: #aaa; } #wp-calendar tbody td { - padding: 3px 0 2px; background: #f5f5f5; - border:1px solid #fff; + border: 1px solid #fff; + padding: 3px 0 2px; text-align: center; } #wp-calendar tbody .pad { @@ -1167,11 +1148,11 @@ h3#reply-title { color: #000; } .widget_rss a.rsswidget:hover { - color: #FF4B33; + color: #ff4b33; } .widget_rss .widget-title img { - height: 11px; width: 11px; + height: 11px; } /* Main sidebars */ @@ -1194,7 +1175,6 @@ h3#reply-title { } - /* =Footer -------------------------------------------------------------- */ @@ -1204,8 +1184,8 @@ h3#reply-title { #colophon { border-top: 4px solid #000; margin-top: -4px; - padding: 18px 0; overflow: hidden; + padding: 18px 0; } #site-info { font-weight: bold; @@ -1215,28 +1195,27 @@ h3#reply-title { text-decoration: none; } #site-generator { - position: relative; font-style: italic; + position: relative; } #site-generator a { - color: #666; - display:inline-block; - text-decoration: none; background: url(images/wordpress.png) center left no-repeat; - padding-left: 20px; + color: #666; + display: inline-block; line-height: 16px; + padding-left: 20px; + text-decoration: none; } #site-generator a:hover { text-decoration: underline; } img#wpstats { - display:block; + display: block; margin: 0 auto 10px; } - -/* Mobile Safari ( iPad, iPhone and iPod Touch ) +/* =Mobile Safari ( iPad, iPhone and iPod Touch ) -------------------------------------------------------------- */ pre { @@ -1257,18 +1236,17 @@ code { } - /* =Print Style -------------------------------------------------------------- */ @media print { body { - background:none !important; + background: none !important; } #wrapper { - float: none !important; clear: both !important; display: block !important; + float: none !important; position: relative !important; } #header { @@ -1281,9 +1259,9 @@ code { #site-title, #site-description { float: none; - margin: 0; - padding:0; line-height: 1.4em; + margin: 0; + padding: 0; } #site-title { font-size: 13pt; @@ -1308,13 +1286,13 @@ code { #container, #header, #footer { - width: 100%; margin: 0; + width: 100%; } #content, .one-column #content { - width: 100%; margin: 24pt 0 0; + width: 100%; } .wp-caption p { font-size: 11pt; @@ -1328,19 +1306,19 @@ code { width: auto; } img#wpstats { - display:none + display: none; } #site-generator a { + margin: 0; padding: 0; - margin: 0; } #entry-author-info { border: 1px solid #e7e7e7; } #main { - display:inline; + display: inline; } .home .sticky { border: none; } -} +} \ No newline at end of file diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 1cbf7d27..20520a41 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -156,8 +156,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $obj = $wp_query->get_queried_object(); - if ( $term_count <= 1 && !empty($obj->term_id) && ( $tax_url = get_term_link((int)$obj->term_id, $obj->taxonomy) ) && !is_wp_error($tax_url) ) { - + if ( $term_count <= 1 && !empty($obj->term_id) && ( $tax_url = get_term_link((int)$obj->term_id, $obj->taxonomy) ) + && !is_wp_error($tax_url) && $redirect['query'] ) { if ( is_category() ) { $redirect['query'] = remove_query_arg( array( 'category_name', 'category', 'cat'), $redirect['query']); } elseif ( is_tag() ) { @@ -343,6 +343,16 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { if ( !$redirect_url || $redirect_url == $requested_url ) return false; + + // Hex encoded octets are case-insensitive. + if ( false !== strpos($requested_url, '%') ) { + if ( !function_exists('lowercase_octets') ) { + function lowercase_octets($matches) { + return strtolower( $matches[0] ); + } + } + $requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url); + } // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE $redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url); diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 6ab08e37..3773b4a8 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -728,7 +728,7 @@ class WP_User { $caps = call_user_func_array( 'map_meta_cap', $args ); // Multisite super admin has all caps by definition, Unless specifically denied. - if ( is_multisite() && is_super_admin() ) { + if ( is_multisite() && is_super_admin( $this->ID ) ) { if ( in_array('do_not_allow', $caps) ) return false; return true; @@ -812,7 +812,7 @@ function map_meta_cap( $cap, $user_id ) { // Fall through case 'edit_users': // If multisite these caps are allowed only for super admins. - if ( is_multisite() && !is_super_admin() ) + if ( is_multisite() && !is_super_admin( $user_id ) ) $caps[] = 'do_not_allow'; else $caps[] = 'edit_users'; // Explicit due to primitive fall through @@ -991,7 +991,7 @@ function map_meta_cap( $cap, $user_id ) { $caps[] = 'read_private_pages'; break; case 'unfiltered_upload': - if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin() ) ) + if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) ) ) $caps[] = $cap; else $caps[] = 'do_not_allow'; @@ -1028,7 +1028,7 @@ function map_meta_cap( $cap, $user_id ) { case 'delete_user': case 'delete_users': // If multisite these caps are allowed only for super admins. - if ( is_multisite() && !is_super_admin() ) + if ( is_multisite() && !is_super_admin( $user_id ) ) $caps[] = 'do_not_allow'; else $caps[] = $cap; @@ -1112,7 +1112,7 @@ function author_can( $post, $capability ) { $author = new WP_User( $post->post_author ); - if ( empty( $author ) ) + if ( empty( $author->ID ) ) return false; $args = array_slice( func_get_args(), 2 ); diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php index d913d6db..3e808692 100644 --- a/wp-includes/class-http.php +++ b/wp-includes/class-http.php @@ -240,7 +240,7 @@ class WP_Http { $arrURL = parse_url($url); - if ( empty( $url ) || empty($url['scheme'] ) ) + if ( empty( $url ) || empty( $arrURL['scheme'] ) ) return new WP_Error('http_request_failed', __('A valid URL was not provided.')); if ( $this->block_request( $url ) ) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 9a136a38..f24a6ec2 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -474,7 +474,7 @@ class WP { function handle_404() { global $wp_query; - if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { + if ( !is_admin() && ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { // Don't 404 for these queries if they matched an object. if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) { if ( !is_404() ) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 4bc9edb8..d3ee1906 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -735,6 +735,33 @@ function trackback_url( $deprecated_echo = true ) { return get_trackback_url(); } +/** + * Generates and displays the RDF for the trackback information of current post. + * + * Deprecated in 3.0.0, and restored in 3.0.1. + * + * @since 0.71 + * + * @param int $deprecated Not used (Was $timezone = 0) + */ +function trackback_rdf( $deprecated = '' ) { + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '2.5' ); + + echo ' + \n"; + echo ''; +} + /** * Whether the current post is open for comments. * @@ -890,7 +917,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false elseif ( file_exists( TEMPLATEPATH . $file ) ) require( TEMPLATEPATH . $file ); else // Backward compat code will be removed in a future release - require( WPINC . '/theme-compat/comments.php'); + require( ABSPATH . WPINC . '/theme-compat/comments.php'); } /** diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index d3f5fc0c..c2b5216b 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -88,7 +88,7 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', // Format WordPress foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter ) - add_filter( $filter, 'capital_P_dangit' ); + add_filter( $filter, 'capital_P_dangit', 11 ); // Format titles foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 47e06860..2c9ec067 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -1067,6 +1067,8 @@ class WP_Widget_Tag_Cloud extends WP_Widget { if ( !$nav_menu ) return; + $instance['title'] = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); + echo $args['before_widget']; if ( !empty($instance['title']) ) diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 77c3e1df..c32a288c 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -2501,19 +2501,6 @@ function funky_javascript_fix($text) { return $text; } -/** - * Generates and displays the RDF for the trackback information of current post. - * - * @since 0.71 - * @deprecated 3.0.0 - * - * @param int $deprecated Not used (Was $timezone = 0) - */ -function trackback_rdf($deprecated = '') { - _deprecated_function( __FUNCTION__, '3.0' ); - return ''; -} - /** * Checks that the taxonomy name exists. * diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 0004673c..58c826f9 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2825,8 +2825,20 @@ function sanitize_text_field($str) { * * @since 3.0.0 */ + function capital_P_dangit( $text ) { - return str_replace( 'Wordpress', 'WordPress', $text ); + // Simple replacement for titles + if ( 'the_title' === current_filter() ) + return str_replace( 'Wordpress', 'WordPress', $text ); + // Still here? Use the more judicious replacement + static $dblq = false; + if ( false === $dblq ) + $dblq = _x('“', 'opening curly quote'); + return str_replace( + array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ), + array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ), + $text ); + } ?> diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index b3712425..333d2642 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -32,7 +32,7 @@ function get_header( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/header.php'); + load_template( ABSPATH . WPINC . '/theme-compat/header.php'); } /** @@ -61,7 +61,7 @@ function get_footer( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/footer.php'); + load_template( ABSPATH . WPINC . '/theme-compat/footer.php'); } /** @@ -90,7 +90,7 @@ function get_sidebar( $name = null ) { // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( WPINC . '/theme-compat/sidebar.php'); + load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); } /** @@ -1721,10 +1721,11 @@ function rich_edit_exists() { * @return bool */ function user_can_richedit() { - global $wp_rich_edit, $pagenow; + global $wp_rich_edit, $pagenow, $is_iphone; if ( !isset( $wp_rich_edit) ) { if ( get_user_option( 'rich_editing' ) == 'true' && + !$is_iphone && // this includes all Safari mobile browsers ( ( preg_match( '!AppleWebKit/(\d+)!', $_SERVER['HTTP_USER_AGENT'], $match ) && intval($match[1]) >= 420 ) || !preg_match( '!opera[ /][2-8]|konqueror|safari!i', $_SERVER['HTTP_USER_AGENT'] ) ) && 'comment.php' != $pagenow ) { diff --git a/wp-includes/kses.php b/wp-includes/kses.php index 8eb046df..4a0a6790 100644 --- a/wp-includes/kses.php +++ b/wp-includes/kses.php @@ -1373,10 +1373,10 @@ function safecss_filter_attr( $css, $deprecated = '' ) { $css = wp_kses_no_null($css); $css = str_replace(array("\n","\r","\t"), '', $css); - if ( preg_match( '%[\\(&]|/\*%', $css ) ) // remove any inline css containing \ ( & or comments + if ( preg_match( '%[\\(&=}]|/\*%', $css ) ) // remove any inline css containing \ ( & } = or comments return ''; - $css_array = split( ';', trim( $css ) ); + $css_array = explode( ';', trim( $css ) ); $allowed_attr = apply_filters( 'safe_style_css', array( 'text-align', 'margin', 'color', 'float', 'border', 'background', 'background-color', 'border-bottom', 'border-bottom-color', 'border-bottom-style', 'border-bottom-width', 'border-collapse', 'border-color', 'border-left', diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 0b92174d..a800da86 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -108,7 +108,7 @@ function get_permalink($id = 0, $leavename = false) { elseif ( $post->post_type == 'attachment' ) return get_attachment_link($post->ID); elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) - return get_post_permalink($post, $leavename, $sample); + return get_post_permalink($post->ID, $leavename, $sample); $permalink = get_option('permalink_structure'); @@ -204,7 +204,7 @@ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { $post_link = home_url($post_link); } - return apply_filters('post_type_link', $post_link, $id, $leavename, $sample); + return apply_filters('post_type_link', $post_link, $post, $leavename, $sample); } /** diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 67ea8611..fe11d0a8 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -113,7 +113,7 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v if ( empty($prev_value) ) { $old_value = get_metadata($meta_type, $object_id, $meta_key); if ( count($old_value) == 1 ) { - if ( $old_value[0] == $meta_value ) + if ( $old_value[0] === $meta_value ) return false; } } diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 80462f30..29d395a7 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -371,7 +371,7 @@ function update_blog_option( $id, $key, $value, $refresh = true ) { } function switch_to_blog( $new_blog, $validate = false ) { - global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache; + global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; if ( empty($new_blog) ) $new_blog = $blog_id; @@ -406,9 +406,12 @@ function switch_to_blog( $new_blog, $validate = false ) { $wp_roles->__construct(); $wpdb->suppress_errors( false ); } - - if ( is_object( $current_user ) ) - $current_user->for_blog( $blog_id ); + + if ( did_action('init') ) { + $current_user = wp_get_current_user(); + if ( is_object( $current_user ) ) + $current_user->for_blog( $blog_id ); + } if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) $global_groups = $wp_object_cache->global_groups; @@ -430,7 +433,7 @@ function switch_to_blog( $new_blog, $validate = false ) { } function restore_current_blog() { - global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache; + global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; if ( !$switched ) return false; @@ -460,8 +463,11 @@ function restore_current_blog() { $wpdb->suppress_errors( false ); } - if ( is_object( $current_user ) ) - $current_user->for_blog( $blog_id ); + if ( did_action('init') ) { + $current_user = wp_get_current_user(); + if ( is_object( $current_user ) ) + $current_user->for_blog( $blog_id ); + } if ( is_object( $wp_object_cache ) && isset( $wp_object_cache->global_groups ) ) $global_groups = $wp_object_cache->global_groups; diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index b6073628..4c3202d7 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -48,10 +48,10 @@ function is_site_admin( $user_login = '' ) { if ( !$user_id ) return false; } else { - $user = new WP_User( null, $user_login) ; - if ( empty( $user->id ) ) + $user = get_user_by( 'login', $user_login ); + if ( empty( $user->ID ) ) return false; - $user_id = $user->id; + $user_id = $user->ID; } return is_super_admin( $user_id ); diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index cd9fbdc2..2b548621 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -209,7 +209,7 @@ function add_user_to_blog( $blog_id, $user_id, $role ) { $user = new WP_User($user_id); - if ( empty($user) || !$user->ID ) + if ( empty( $user->ID ) ) return new WP_Error('user_does_not_exist', __('That user does not exist.')); if ( !get_user_meta($user_id, 'primary_blog', true) ) { @@ -253,6 +253,9 @@ function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') { // wp_revoke_user($user_id); $user = new WP_User($user_id); + if ( empty( $user->ID ) ) + return new WP_Error('user_does_not_exist', __('That user does not exist.')); + $user->remove_all_caps(); $blogs = get_blogs_of_user($user_id); @@ -372,8 +375,9 @@ function wpmu_admin_redirect_add_updated_param( $url = '' ) { } function is_blog_user( $blog_id = 0 ) { - global $current_user, $wpdb; - + global $wpdb; + + $current_user = wp_get_current_user(); if ( !$blog_id ) $blog_id = $wpdb->blogid; @@ -652,7 +656,7 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $message = sprintf( apply_filters( 'wpmu_signup_blog_notification_email', __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ) ), $activate_url, esc_url( "http://{$domain}{$path}" ), $key ); // TODO: Don't hard code activation link. - $subject = sprintf( apply_filters( 'wpmu_signup_blog_notification_subject', __( '[%1s] Activate %2s' ) ), $from_name, esc_url( 'http://' . $domain . $path ) ); + $subject = sprintf( apply_filters( 'wpmu_signup_blog_notification_subject', __( '[%1$s] Activate %2$s' ) ), $from_name, esc_url( 'http://' . $domain . $path ) ); wp_mail($user_email, $subject, $message, $message_headers); return true; } @@ -669,7 +673,7 @@ function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') { $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), site_url( "wp-activate.php?key=$key" ), $key ); // TODO: Don't hard code activation link. - $subject = sprintf( __( apply_filters( 'wpmu_signup_user_notification_subject', '[%1s] Activate %2s' ) ), $from_name, $user); + $subject = sprintf( __( apply_filters( 'wpmu_signup_user_notification_subject', '[%1$s] Activate %2$s' ) ), $from_name, $user); wp_mail($user_email, $subject, $message, $message_headers); return true; } @@ -1319,17 +1323,13 @@ function fix_phpmailer_messageid( $phpmailer ) { function is_user_spammy( $username = 0 ) { if ( $username == 0 ) { - global $current_user; - $user_id = $current_user->ID; + $user_id = get_current_user_id(); } else { $user_id = get_user_id_from_string( $username ); } $u = new WP_User( $user_id ); - if ( $u->spam == 1 ) - return true; - - return false; + return ( isset( $u->spam ) && $u->spam == 1 ); } function update_blog_public( $old_value, $value ) { @@ -1360,8 +1360,9 @@ function get_dashboard_blog() { } function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { - global $current_user, $wpdb; + global $wpdb; + $current_user = wp_get_current_user(); if ( $user_id == 0 ) $user_id = $current_user->ID; if ( $blog_id == 0 ) diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index bcb075cd..fc16faac 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -182,11 +182,10 @@ function wpmu_current_site() { } // Still no dice. - // @todo Update or remove WPMU codex link. if ( 1 == count( $sites ) ) wp_die( sprintf( /*WP_I18N_BLOG_DOESNT_EXIST*/'That site does not exist. Please try %s.'/*/WP_I18N_BLOG_DOESNT_EXIST*/, $sites[0]->domain . $sites[0]->path ) ); else - wp_die( /*WP_I18N_NO_SITE_DEFINED*/'No site defined on this host. If you are the owner of this site, please check Debugging WPMU for help.'/*/WP_I18N_NO_SITE_DEFINED*/ ); + wp_die( /*WP_I18N_NO_SITE_DEFINED*/'No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.'/*/WP_I18N_NO_SITE_DEFINED*/ ); } /** @@ -194,8 +193,6 @@ function wpmu_current_site() { * * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well. * - * @todo update Codex link for 3.0.0 - * * @access private * @since 3.0.0 */ @@ -213,7 +210,7 @@ function ms_not_installed() { else $msg .= '

' . sprintf( /*WP_I18N_NO_SITE_FOUND*/'Could not find site %1$s. Searched for table %2$s in database %3$s. Is that right?'/*/WP_I18N_NO_SITE_FOUND*/, rtrim( $domain . $path, '/' ), $wpdb->blogs, DB_NAME ) . '

'; $msg .= '

' . /*WP_I18N_WHAT_DO_I_DO*/'What do I do now?'/*WP_I18N_WHAT_DO_I_DO*/ . ' '; - $msg .= /*WP_I18N_RTFM*/'Read the bug report page. Some of the guidelines there may help you figure out what went wrong.'/*/WP_I18N_RTFM*/; + $msg .= /*WP_I18N_RTFM*/'Read the bug report page. Some of the guidelines there may help you figure out what went wrong.'/*/WP_I18N_RTFM*/; $msg .= ' ' . /*WP_I18N_STUCK*/'If you’re still stuck with this message, then check that your database contains the following tables:'/*/WP_I18N_STUCK*/ . '

    '; foreach ( $wpdb->tables('global') as $t => $table ) { if ( 'sitecategories' == $t ) diff --git a/wp-includes/nav-menu-template.php b/wp-includes/nav-menu-template.php index d2fb493b..b9c05870 100644 --- a/wp-includes/nav-menu-template.php +++ b/wp-includes/nav-menu-template.php @@ -71,11 +71,15 @@ class Walker_Nav_Menu extends Walker { $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; + $classes[] = 'menu-item-' . $item->ID; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); $class_names = ' class="' . esc_attr( $class_names ) . '"'; - $output .= $indent . '