Commit b6691b17 authored by lechuck's avatar lechuck Committed by lechuck
Browse files

Upgrade to wp 3.4.1

parent f6d84d54
......@@ -930,10 +930,9 @@ final class WP_Theme implements ArrayAccess {
$files = (array) $this->get_files( 'php', 1 );
foreach ( $files as $file => $full_path ) {
$headers = get_file_data( $full_path, array( 'Template Name' => 'Template Name' ) );
if ( empty( $headers['Template Name'] ) )
if ( ! preg_match( '|Template Name:(.*)$|mi', file_get_contents( $full_path ), $header ) )
continue;
$page_templates[ $file ] = $headers['Template Name'];
$page_templates[ $file ] = _cleanup_header_comment( $header[1] );
}
$this->cache_add( 'page_templates', $page_templates );
......
......@@ -1337,7 +1337,7 @@ class wp_xmlrpc_server extends IXR_Server {
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
$post_type = get_post_type_object( $post['post_type'] );
if ( ! current_user_can( $post_type->cap->edit_posts, $post_id ) )
if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) )
return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
return $this->_prepare_post( $post, $fields );
......@@ -1394,12 +1394,14 @@ class wp_xmlrpc_server extends IXR_Server {
$post_type = get_post_type_object( $filter['post_type'] );
if ( ! ( (bool) $post_type ) )
return new IXR_Error( 403, __( 'The post type specified is not valid' ) );
} else {
$post_type = get_post_type_object( 'post' );
}
if ( ! current_user_can( $post_type->cap->edit_posts ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
if ( ! current_user_can( $post_type->cap->edit_posts ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
$query['post_type'] = $filter['post_type'];
}
$query['post_type'] = $post_type->name;
if ( isset( $filter['post_status'] ) )
$query['post_status'] = $filter['post_status'];
......@@ -1427,7 +1429,7 @@ class wp_xmlrpc_server extends IXR_Server {
foreach ( $posts_list as $post ) {
$post_type = get_post_type_object( $post['post_type'] );
if ( ! current_user_can( $post_type->cap->edit_posts, $post['ID'] ) )
if ( ! current_user_can( $post_type->cap->edit_post, $post['ID'] ) )
continue;
$struct[] = $this->_prepare_post( $post, $fields );
......
......@@ -31,10 +31,8 @@ class WP_Scripts extends WP_Dependencies {
var $default_dirs;
function __construct() {
if ( ! function_exists( 'did_action' ) || did_action( 'init' ) )
$this->init();
else
add_action( 'init', array( $this, 'init' ), 0 );
$this->init();
add_action( 'init', array( $this, 'init' ), 0 );
}
function init() {
......
......@@ -1835,99 +1835,19 @@ function get_allowed_mime_types() {
/**
* Retrieve nonce action "Are you sure" message.
*
* The action is split by verb and noun. The action format is as follows:
* verb-action_extra. The verb is before the first dash and has the format of
* letters and no spaces and numbers. The noun is after the dash and before the
* underscore, if an underscore exists. The noun is also only letters.
*
* The filter will be called for any action, which is not defined by WordPress.
* You may use the filter for your plugin to explain nonce actions to the user,
* when they get the "Are you sure?" message. The filter is in the format of
* 'explain_nonce_$verb-$noun' with the $verb replaced by the found verb and the
* $noun replaced by the found noun. The two parameters that are given to the
* hook are the localized "Are you sure you want to do this?" message with the
* extra text (the text after the underscore).
* Deprecated in 3.4.1 and 3.5.0. Backported to 3.3.3.
*
* @package WordPress
* @subpackage Security
* @since 2.0.4
* @deprecated 3.4.1
* @deprecated Use wp_nonce_ays()
* @see wp_nonce_ays()
*
* @param string $action Nonce action.
* @return string Are you sure message.
*/
function wp_explain_nonce( $action ) {
if ( $action !== -1 && preg_match( '/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches ) ) {
$verb = $matches[1];
$noun = $matches[2];
$trans = array();
$trans['update']['attachment'] = array( __( 'Your attempt to edit this attachment: “%s” has failed.' ), 'get_the_title' );
$trans['add']['category'] = array( __( 'Your attempt to add this category has failed.' ), false );
$trans['delete']['category'] = array( __( 'Your attempt to delete this category: “%s” has failed.' ), 'get_cat_name' );
$trans['update']['category'] = array( __( 'Your attempt to edit this category: “%s” has failed.' ), 'get_cat_name' );
$trans['delete']['comment'] = array( __( 'Your attempt to delete this comment: “%s” has failed.' ), 'use_id' );
$trans['unapprove']['comment'] = array( __( 'Your attempt to unapprove this comment: “%s” has failed.' ), 'use_id' );
$trans['approve']['comment'] = array( __( 'Your attempt to approve this comment: “%s” has failed.' ), 'use_id' );
$trans['update']['comment'] = array( __( 'Your attempt to edit this comment: “%s” has failed.' ), 'use_id' );
$trans['bulk']['comments'] = array( __( 'Your attempt to bulk modify comments has failed.' ), false );
$trans['moderate']['comments'] = array( __( 'Your attempt to moderate comments has failed.' ), false );
$trans['add']['bookmark'] = array( __( 'Your attempt to add this link has failed.' ), false );
$trans['delete']['bookmark'] = array( __( 'Your attempt to delete this link: “%s” has failed.' ), 'use_id' );
$trans['update']['bookmark'] = array( __( 'Your attempt to edit this link: “%s” has failed.' ), 'use_id' );
$trans['bulk']['bookmarks'] = array( __( 'Your attempt to bulk modify links has failed.' ), false );
$trans['add']['page'] = array( __( 'Your attempt to add this page has failed.' ), false );
$trans['delete']['page'] = array( __( 'Your attempt to delete this page: “%s” has failed.' ), 'get_the_title' );
$trans['update']['page'] = array( __( 'Your attempt to edit this page: “%s” has failed.' ), 'get_the_title' );
$trans['edit']['plugin'] = array( __( 'Your attempt to edit this plugin file: “%s” has failed.' ), 'use_id' );
$trans['activate']['plugin'] = array( __( 'Your attempt to activate this plugin: “%s” has failed.' ), 'use_id' );
$trans['deactivate']['plugin'] = array( __( 'Your attempt to deactivate this plugin: “%s” has failed.' ), 'use_id' );
$trans['upgrade']['plugin'] = array( __( 'Your attempt to update this plugin: “%s” has failed.' ), 'use_id' );
$trans['add']['post'] = array( __( 'Your attempt to add this post has failed.' ), false );
$trans['delete']['post'] = array( __( 'Your attempt to delete this post: “%s” has failed.' ), 'get_the_title' );
$trans['update']['post'] = array( __( 'Your attempt to edit this post: “%s” has failed.' ), 'get_the_title' );
$trans['add']['user'] = array( __( 'Your attempt to add this user has failed.' ), false );
$trans['delete']['users'] = array( __( 'Your attempt to delete users has failed.' ), false );
$trans['bulk']['users'] = array( __( 'Your attempt to bulk modify users has failed.' ), false );
$trans['update']['user'] = array( __( 'Your attempt to edit this user: “%s” has failed.' ), 'get_the_author_meta', 'display_name' );
$trans['update']['profile'] = array( __( 'Your attempt to modify the profile for: “%s” has failed.' ), 'get_the_author_meta', 'display_name' );
$trans['update']['options'] = array( __( 'Your attempt to edit your settings has failed.' ), false );
$trans['update']['permalink'] = array( __( 'Your attempt to change your permalink structure to: %s has failed.' ), 'use_id' );
$trans['edit']['file'] = array( __( 'Your attempt to edit this file: “%s” has failed.' ), 'use_id' );
$trans['edit']['theme'] = array( __( 'Your attempt to edit this theme file: “%s” has failed.' ), 'use_id' );
$trans['switch']['theme'] = array( __( 'Your attempt to switch to this theme: “%s” has failed.' ), 'use_id' );
$trans['log']['out'] = array( sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'sitename' ) ), false );
if ( isset( $trans[$verb][$noun] ) ) {
if ( !empty( $trans[$verb][$noun][1] ) ) {
$lookup = $trans[$verb][$noun][1];
if ( isset($trans[$verb][$noun][2]) )
$lookup_value = $trans[$verb][$noun][2];
$object = $matches[4];
if ( 'use_id' != $lookup ) {
if ( isset( $lookup_value ) )
$object = call_user_func( $lookup, $lookup_value, $object );
else
$object = call_user_func( $lookup, $object );
}
return sprintf( $trans[$verb][$noun][0], esc_html($object) );
} else {
return $trans[$verb][$noun][0];
}
}
return apply_filters( 'explain_nonce_' . $verb . '-' . $noun, __( 'Are you sure you want to do this?' ), isset($matches[4]) ? $matches[4] : '' );
} else {
return apply_filters( 'explain_nonce_' . $action, __( 'Are you sure you want to do this?' ) );
}
_deprecated_function( __FUNCTION__, '3.4.1', 'wp_nonce_ays()' );
return __( 'Are you sure you want to do this?' );
}
/**
......@@ -1944,11 +1864,14 @@ function wp_explain_nonce( $action ) {
*/
function wp_nonce_ays( $action ) {
$title = __( 'WordPress Failure Notice' );
$html = esc_html( wp_explain_nonce( $action ) );
if ( 'log-out' == $action )
$html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() );
elseif ( wp_get_referer() )
$html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";
if ( 'log-out' == $action ) {
$html = sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ) . '</p><p>';
$html .= sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() );
} else {
$html = __( 'Are you sure you want to do this?' );
if ( wp_get_referer() )
$html .= "</p><p><a href='" . esc_url( remove_query_arg( 'updated', wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>";
}
wp_die( $html, $title, array('response' => 403) );
}
......@@ -3622,7 +3545,11 @@ function wp_allowed_protocols() {
* @return string|array Either a string containing a reversed comma separated trace or an array of individual calls.
*/
function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
$trace = debug_backtrace( false );
if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) )
$trace = debug_backtrace( false );
else
$trace = debug_backtrace();
$caller = array();
$check_class = ! is_null( $ignore_class );
$skip_frames++; // skip this function
......@@ -3690,7 +3617,7 @@ function _device_can_upload() {
if ( strpos($ua, 'iPhone') !== false
|| strpos($ua, 'iPad') !== false
|| strpos($ua, 'iPod') !== false ) {
return false;
return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' );
} else {
return true;
}
......
......@@ -88,7 +88,12 @@
preview.trigger( event, args );
});
preview.send( 'synced' );
})
});
preview.bind( 'active', function() {
if ( api.settings.nonce )
preview.send( 'nonce', api.settings.nonce );
});
preview.send( 'ready' );
......
(function(b,d){var c=wp.customize,a;a=function(g,e,f){var h;return function(){var i=arguments;f=f||this;clearTimeout(h);h=setTimeout(function(){h=null;g.apply(f,i)},e)}};c.Preview=c.Messenger.extend({initialize:function(g,f){var e=this;c.Messenger.prototype.initialize.call(this,g,f);this.body=d(document.body);this.body.on("click.preview","a",function(h){h.preventDefault();e.send("scroll",0);e.send("url",d(this).prop("href"))});this.body.on("submit.preview","form",function(h){h.preventDefault()});this.window=d(window);this.window.on("scroll.preview",a(function(){e.send("scroll",e.window.scrollTop())},200));this.bind("scroll",function(h){e.window.scrollTop(h)})}});d(function(){c.settings=window._wpCustomizeSettings;if(!c.settings){return}var f,e;f=new c.Preview({url:window.location.href,channel:c.settings.channel});f.bind("settings",function(g){d.each(g,function(i,h){if(c.has(i)){c(i).set(h)}else{c.create(i,h)}})});f.trigger("settings",c.settings.values);f.bind("setting",function(g){var h;g=g.slice();if(h=c(g.shift())){h.set.apply(h,g)}});f.bind("sync",function(g){d.each(g,function(i,h){f.trigger(i,h)});f.send("synced")});f.send("ready");e=d.map(["color","image","position_x","repeat","attachment"],function(g){return"background_"+g});c.when.apply(c,e).done(function(j,i,m,h,l){var n=d(document.body),o=d("head"),g=d("#custom-background-css"),k;if(n.hasClass("custom-background")&&!g.length){return}k=function(){var p="";n.toggleClass("custom-background",!!(j()||i()));if(j()){p+="background-color: "+j()+";"}if(i()){p+='background-image: url("'+i()+'");';p+="background-position: top "+m()+";";p+="background-repeat: "+h()+";";p+="background-position: top "+l()+";"}g.remove();g=d('<style type="text/css" id="custom-background-css">body.custom-background { '+p+" }</style>").appendTo(o)};d.each(arguments,function(){this.bind(k)})})})})(wp,jQuery);
\ No newline at end of file
(function(b,d){var c=wp.customize,a;a=function(g,e,f){var h;return function(){var i=arguments;f=f||this;clearTimeout(h);h=setTimeout(function(){h=null;g.apply(f,i)},e)}};c.Preview=c.Messenger.extend({initialize:function(g,f){var e=this;c.Messenger.prototype.initialize.call(this,g,f);this.body=d(document.body);this.body.on("click.preview","a",function(h){h.preventDefault();e.send("scroll",0);e.send("url",d(this).prop("href"))});this.body.on("submit.preview","form",function(h){h.preventDefault()});this.window=d(window);this.window.on("scroll.preview",a(function(){e.send("scroll",e.window.scrollTop())},200));this.bind("scroll",function(h){e.window.scrollTop(h)})}});d(function(){c.settings=window._wpCustomizeSettings;if(!c.settings){return}var f,e;f=new c.Preview({url:window.location.href,channel:c.settings.channel});f.bind("settings",function(g){d.each(g,function(i,h){if(c.has(i)){c(i).set(h)}else{c.create(i,h)}})});f.trigger("settings",c.settings.values);f.bind("setting",function(g){var h;g=g.slice();if(h=c(g.shift())){h.set.apply(h,g)}});f.bind("sync",function(g){d.each(g,function(i,h){f.trigger(i,h)});f.send("synced")});f.bind("active",function(){if(c.settings.nonce){f.send("nonce",c.settings.nonce)}});f.send("ready");e=d.map(["color","image","position_x","repeat","attachment"],function(g){return"background_"+g});c.when.apply(c,e).done(function(j,i,m,h,l){var n=d(document.body),o=d("head"),g=d("#custom-background-css"),k;if(n.hasClass("custom-background")&&!g.length){return}k=function(){var p="";n.toggleClass("custom-background",!!(j()||i()));if(j()){p+="background-color: "+j()+";"}if(i()){p+='background-image: url("'+i()+'");';p+="background-position: top "+m()+";";p+="background-repeat: "+h()+";";p+="background-position: top "+l()+";"}g.remove();g=d('<style type="text/css" id="custom-background-css">body.custom-background { '+p+" }</style>").appendTo(o)};d.each(arguments,function(){this.bind(k)})})})})(wp,jQuery);
\ No newline at end of file
......@@ -392,7 +392,7 @@ function load_default_textdomain() {
return;
}
if ( is_admin() )
if ( is_admin() || ( defined( 'WP_REPAIRING' ) && WP_REPAIRING ) )
load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" );
if ( is_network_admin() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ) )
......
......@@ -1220,7 +1220,7 @@ function get_the_password_form() {
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
<p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
<p><label for="' . $label . '">' . __("Password:") . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__("Submit") . '" /></p>
</form>
</form>
';
return apply_filters('the_password_form', $output);
}
......
......@@ -1537,7 +1537,7 @@ class WP_Rewrite {
$registration_pages['.*wp-register.php$'] = $this->index . '?register=true'; // Deprecated
// Post
$post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK, false, true, false, false );
$post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK, false );
$post_rewrite = apply_filters('post_rewrite_rules', $post_rewrite);
// Date
......
......@@ -62,14 +62,14 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js" );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
$scripts->localize( 'common', 'commonL10n', array(
did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.")
) );
$scripts->add( 'sack', "/wp-includes/js/tw-sack$suffix.js", array(), '1.6.1', 1 );
$scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 );
$scripts->localize( 'quicktags', 'quicktagsL10n', array(
did_action( 'init' ) && $scripts->localize( 'quicktags', 'quicktagsL10n', array(
'wordLookup' => __('Enter a word to look up:'),
'dictionaryLookup' => esc_attr(__('Dictionary lookup')),
'lookup' => esc_attr(__('lookup')),
......@@ -93,13 +93,13 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', array(), '1.6.1');
$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
$scripts->localize( 'wp-ajax-response', 'wpAjax', array(
did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array(
'noPerm' => __('You do not have permission to do that.'),
'broken' => __('An unidentified error has occurred.')
) );
$scripts->add( 'wp-pointer', "/wp-includes/js/wp-pointer$suffix.js", array( 'jquery-ui-widget', 'jquery-ui-position' ), '20111129a', 1 );
$scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
did_action( 'init' ) && $scripts->localize( 'wp-pointer', 'wpPointerL10n', array(
'dismiss' => __('Dismiss'),
) );
......@@ -170,7 +170,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'jquery-touch-punch', "/wp-includes/js/jquery/jquery.ui.touch-punch.js", array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );
$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20111117', 1 );
$scripts->localize( 'thickbox', 'thickboxL10n', array(
did_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(
'next' => __('Next &gt;'),
'prev' => __('&lt; Prev'),
'image' => __('Image'),
......@@ -227,10 +227,10 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1.5.4' );
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery') );
$scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
did_action( 'init' ) && $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
$scripts->add( 'wp-plupload', "/wp-includes/js/plupload/wp-plupload$suffix.js", array('plupload-all', 'jquery', 'json2') );
$scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );
did_action( 'init' ) && $scripts->localize( 'wp-plupload', 'pluploadL10n', $uploader_l10n );
// keep 'swfupload' for back-compat.
$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', array(), '2201-20110113');
......@@ -246,7 +246,7 @@ function wp_default_scripts( &$scripts ) {
}
$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20110524');
$scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
did_action( 'init' ) && $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
$scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js" );
......@@ -255,7 +255,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 );
$scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 );
$scripts->localize( 'password-strength-meter', 'pwsL10n', array(
did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
'empty' => __('Strength indicator'),
'short' => __('Very weak'),
'bad' => __('Weak'),
......@@ -272,7 +272,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), false, 1 );
$scripts->localize( 'wplink', 'wpLinkL10n', array(
did_action( 'init' ) && $scripts->localize( 'wplink', 'wpLinkL10n', array(
'title' => __('Insert/edit link'),
'update' => __('Update'),
'save' => __('Add Link'),
......@@ -285,7 +285,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'wpdialogs-popup', "/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js", array( 'wpdialogs' ), false, 1 );
$scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), false, 1 );
$scripts->localize( 'word-count', 'wordCountL10n', array(
did_action( 'init' ) && $scripts->localize( 'word-count', 'wordCountL10n', array(
/* translators: If your word count is based on single characters (East Asian characters),
enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
'type' => 'characters' == _x( 'words', 'word count: words or characters?' ) ? 'c' : 'w',
......@@ -299,7 +299,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'customize-loader', "/wp-includes/js/customize-loader$suffix.js", array( 'customize-base' ), false, 1 );
$scripts->add( 'customize-preview', "/wp-includes/js/customize-preview$suffix.js", array( 'customize-base' ), false, 1 );
$scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base' ), false, 1 );
$scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
'activate' => __( 'Save &amp; Activate' ),
'save' => __( 'Save &amp; Publish' ),
'saved' => __( 'Saved' ),
......@@ -311,7 +311,7 @@ function wp_default_scripts( &$scripts ) {
if ( is_admin() ) {
$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ) );
$scripts->add_data( 'ajaxcat', 'group', 1 );
$scripts->localize( 'ajaxcat', 'catL10n', array(
did_action( 'init' ) && $scripts->localize( 'ajaxcat', 'catL10n', array(
'add' => esc_attr(__('Add')),
'how' => __('Separate multiple categories with commas.')
) );
......@@ -319,7 +319,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), false, 1 );
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 );
$scripts->localize( 'admin-tags', 'tagsl10n', array(
did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
'noPerm' => __('You do not have permission to do that.'),
'broken' => __('An unidentified error has occurred.')
));
......@@ -327,7 +327,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), false, 1 );
$scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
did_action( 'init' ) && $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
'replyApprove' => __( 'Approve and Reply' ),
......@@ -339,7 +339,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 );
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), false, 1 );
$scripts->localize( 'post', 'postL10n', array(
did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array(
'ok' => __('OK'),
'cancel' => __('Cancel'),
'publishOn' => __('Publish on:'),
......@@ -365,7 +365,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array('jquery') );
$scripts->add_data( 'comment', 'group', 1 );
$scripts->localize( 'comment', 'commentL10n', array(
did_action( 'init' ) && $scripts->localize( 'comment', 'commentL10n', array(
'submittedOn' => __('Submitted on:')
) );
......@@ -379,7 +379,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), false, 1 );
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
'ntdeltitle' => __('Remove From Bulk Edit'),
'notitle' => __('(no title)'),
......@@ -387,12 +387,12 @@ function wp_default_scripts( &$scripts ) {
) );
$scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 );
$scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.')
) );
$scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), false, 1 );
$scripts->localize( 'plugin-install', 'plugininstallL10n', array(
did_action( 'init' ) && $scripts->localize( 'plugin-install', 'plugininstallL10n', array(
'plugin_information' => __('Plugin Information:'),
'ays' => __('Are you sure you want to install this plugin?')
) );
......@@ -406,12 +406,12 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable' ), false, 1 );
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), false, 1 );
$scripts->localize( 'image-edit', 'imageEditL10n', array(
did_action( 'init' ) && $scripts->localize( 'image-edit', 'imageEditL10n', array(
'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
));
$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
$scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
'setThumbnail' => __( 'Use as featured image' ),
'saving' => __( 'Saving...' ),
'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
......@@ -420,7 +420,7 @@ function wp_default_scripts( &$scripts ) {
// Navigation Menus
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable') );
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array(
'noResultsFound' => _x('No results found.', 'search results'),
'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
......
......@@ -381,7 +381,7 @@ function search_theme_directories( $force = false ) {
if ( ! $sub_dirs )
return false;
foreach ( $sub_dirs as $sub_dir ) {
if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' )
if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' )
continue;
if ( ! file_exists( $theme_root . '/' . $dir . '/' . $sub_dir . '/style.css' ) )
continue;
......
......@@ -58,6 +58,7 @@ function wp_version_check() {
$multisite_enabled = 1;
} else {
$user_count = count_users( );
$user_count = $user_count['total_users'];
$multisite_enabled = 0;
$num_blogs = 1;
$wp_install = home_url( '/' );
......@@ -70,7 +71,7 @@ function wp_version_check() {
'mysql' => $mysql_version,
'local_package' => isset( $wp_local_package ) ? $wp_local_package : '',
'blogs' => $num_blogs,
'users' => $user_count['total_users'],
'users' => $user_count,
'multisite_enabled' => $multisite_enabled
);
......
......@@ -4,14 +4,14 @@
*
* @global string $wp_version
*/
$wp_version = '3.4';
$wp_version = '3.4.1';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 20596;
$wp_db_version = 21115;
/**
* Holds the TinyMCE version
......
......@@ -39,7 +39,7 @@ if ( force_ssl_admin() && !is_ssl() ) {
* @param WP_Error $wp_error Optional. WordPress Error Object
*/
function login_header($title = 'Log In', $message = '', $wp_error = '') {
global $error, $interim_login, $current_site, $customize_login;
global $error, $interim_login, $current_site;
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
......@@ -68,9 +68,6 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
<meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /><?php
}
if ( $customize_login )
wp_enqueue_script( 'customize-base' );
do_action( 'login_enqueue_scripts' );
do_action( 'login_head' );
......@@ -568,6 +565,8 @@ default:
$secure_cookie = '';
$interim_login = isset($_REQUEST['interim-login']);
$customize_login = isset( $_REQUEST['customize-login'] );
if ( $customize_login )
wp_enqueue_script( 'customize-base' );
// If the user wants ssl but the session is not ssl, force a secure cookie.
if ( !empty($_POST['log']) && !force_ssl_admin() ) {
......@@ -604,21 +603,18 @@ default:
if ( !is_wp_error($user) && !$reauth ) {
if ( $interim_login ) {
$message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
login_header( '', $message );
if ( ! $customize_login ) : ?>
<script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
<p class="alignright">
<input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
<?php endif;
?></div><?php
do_action('login_footer');
if ( $customize_login ) : ?>
login_header( '', $message ); ?>
<?php if ( ! $customize_login ) : ?>
<script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
<p class="alignright">
<input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
<?php endif; ?>
</div>
<?php do_action( 'login_footer' ); ?>
<?php if ( $customize_login ) : ?>
<script type="text/javascript">setTimeout( function(){ new wp.customize.Messenger({ url: '<?php echo wp_customize_url(); ?>', channel: 'login' }).send('login') }, 1000 );</script>
<?php endif; ?>
<?php endif; ?>
</body></html>
<?php exit;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment