From: Edward Z. Yang
Date: Sun, 18 Dec 2011 20:04:21 +0000 (-0500)
Subject: Wordpress 3.3
X-Git-Tag: wordpress-3.3
X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/commitdiff_plain/5aa86a9053fb0fa15846bb60aac2fb8fdfff524a
Wordpress 3.3
Signed-off-by: Edward Z. Yang
---
diff --git a/readme.html b/readme.html
index 691753e2..72e21ee6 100644
--- a/readme.html
+++ b/readme.html
@@ -8,7 +8,7 @@
- Version 3.2.1
+ Version 3.3
Semantic Personal Publishing Platform
diff --git a/wp-activate.php b/wp-activate.php
index 1ec40287..4f720709 100644
--- a/wp-activate.php
+++ b/wp-activate.php
@@ -63,9 +63,9 @@ get_header();
';
if ( $signup->domain . $signup->path == '' ) {
- printf( __('Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
+ printf( __('Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() );
} else {
- printf( __('Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) );
+ printf( __('Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() );
}
echo '
Tools → Import to get the new Tumblr Importer, which maps your Tumblog posts to the matching WordPress post formats. Tip: Choose a theme designed to display post formats to get the greatest benefit from the importer.' ); ?>
+
+
+
+
Note: if you’ve added new widgets since the switch, you’ll need to rescue them from the Inactive Widgets area.' ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
is_main_query()
+
WP_Query object is the main WordPress query or a secondary query.' ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+Version %1$s addressed a security issue.',
+ 'Version %1$s addressed some security issues.' );
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. */
+_n_noop( 'Version %1$s addressed %2$s bug.',
+ 'Version %1$s addressed %2$s bugs.' );
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
+_n_noop( 'Version %1$s addressed a security issue and fixed %2$s bug.',
+ 'Version %1$s addressed a security issue and fixed %2$s bugs.' );
+
+/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
+_n_noop( 'Version %1$s addressed some security issues and fixed %2$s bug.',
+ 'Version %1$s addressed some security issues and fixed %2$s bugs.' );
+
+__( 'For more information, see the release notes.' );
+
+?>
\ No newline at end of file
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php
index 18a853bf..c21c861e 100644
--- a/wp-admin/admin-ajax.php
+++ b/wp-admin/admin-ajax.php
@@ -55,10 +55,7 @@ case 'fetch-list' :
$list_class = $_GET['list_args']['class'];
check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
- $current_screen = (object) $_GET['list_args']['screen'];
- //TODO fix this in a better way see #15336
- $current_screen->is_network = 'false' === $current_screen->is_network ? false : true;
- $current_screen->is_user = 'false' === $current_screen->is_user ? false : true;
+ $current_screen = convert_to_screen( $_GET['list_args']['screen']['id'] );
define( 'WP_NETWORK_ADMIN', $current_screen->is_network );
define( 'WP_USER_ADMIN', $current_screen->is_user );
@@ -321,7 +318,7 @@ switch ( $action = $_POST['action'] ) :
case 'delete-comment' : // On success, die with time() instead of 1
if ( !$comment = get_comment( $id ) )
die( (string) time() );
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
die('-1');
check_ajax_referer( "delete-comment_$id" );
@@ -393,10 +390,10 @@ case 'delete-link' :
break;
case 'delete-meta' :
check_ajax_referer( "delete-meta_$id" );
- if ( !$meta = get_post_meta_by_id( $id ) )
+ if ( !$meta = get_metadata_by_mid( 'post', $id ) )
die('1');
- if ( !current_user_can( 'edit_post', $meta->post_id ) || is_protected_meta( $meta->meta_key ) )
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || ! current_user_can( 'delete_post_meta', $meta->post_id, $meta->meta_key ) )
die('-1');
if ( delete_meta( $meta->meta_id ) )
die('1');
@@ -457,7 +454,7 @@ case 'dim-comment' : // On success, die with time() instead of 1
$x->send();
}
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) && ! current_user_can( 'moderate_comments' ) )
die('-1');
$current = wp_get_comment_status( $comment->comment_ID );
@@ -612,6 +609,8 @@ case 'get-comments' :
$x = new WP_Ajax_Response();
ob_start();
foreach ( $wp_list_table->items as $comment ) {
+ if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) )
+ continue;
get_comment( $comment );
$wp_list_table->single_row( $comment );
}
@@ -638,7 +637,7 @@ case 'replyto-comment' :
if ( empty($status) )
die('1');
elseif ( in_array($status, array('draft', 'pending', 'trash') ) )
- die( __('Error: you are replying to a comment on a draft post.') );
+ die( __('ERROR: you are replying to a comment on a draft post.') );
$user = wp_get_current_user();
if ( $user->ID ) {
@@ -646,8 +645,8 @@ case 'replyto-comment' :
$comment_author_email = $wpdb->escape($user->user_email);
$comment_author_url = $wpdb->escape($user->user_url);
$comment_content = trim($_POST['content']);
- if ( current_user_can('unfiltered_html') ) {
- if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
+ if ( current_user_can( 'unfiltered_html' ) ) {
+ if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
kses_remove_filters(); // start with a clean slate
kses_init_filters(); // set up the filters
}
@@ -657,7 +656,7 @@ case 'replyto-comment' :
}
if ( '' == $comment_content )
- die( __('Error: please type a comment.') );
+ die( __('ERROR: please type a comment.') );
$comment_parent = absint($_POST['comment_ID']);
$comment_auto_approved = false;
@@ -714,14 +713,13 @@ case 'edit-comment' :
set_current_screen( 'edit-comments' );
- $comment_post_ID = (int) $_POST['comment_post_ID'];
- if ( ! current_user_can( 'edit_post', $comment_post_ID ) )
+ $comment_id = (int) $_POST['comment_ID'];
+ if ( ! current_user_can( 'edit_comment', $comment_id ) )
die('-1');
if ( '' == $_POST['content'] )
- die( __('Error: please type a comment.') );
+ die( __('ERROR: please type a comment.') );
- $comment_id = (int) $_POST['comment_ID'];
$_POST['comment_status'] = $_POST['status'];
edit_comment();
@@ -848,7 +846,7 @@ case 'add-meta' :
die(__('Please provide a custom field value.'));
}
- $meta = get_post_meta_by_id( $mid );
+ $meta = get_metadata_by_mid( 'post', $mid );
$pid = (int) $meta->post_id;
$meta = get_object_vars( $meta );
$x = new WP_Ajax_Response( array(
@@ -859,26 +857,24 @@ case 'add-meta' :
'supplemental' => array('postid' => $pid)
) );
} else { // Update?
- $mid = (int) array_pop( array_keys($_POST['meta']) );
- $key = $_POST['meta'][$mid]['key'];
- $value = $_POST['meta'][$mid]['value'];
+ $mid = (int) key( $_POST['meta'] );
+ $key = stripslashes( $_POST['meta'][$mid]['key'] );
+ $value = stripslashes( $_POST['meta'][$mid]['value'] );
if ( '' == trim($key) )
die(__('Please provide a custom field name.'));
if ( '' == trim($value) )
die(__('Please provide a custom field value.'));
- if ( !$meta = get_post_meta_by_id( $mid ) )
+ if ( ! $meta = get_metadata_by_mid( 'post', $mid ) )
die('0'); // if meta doesn't exist
- if ( !current_user_can( 'edit_post', $meta->post_id ) )
- die('-1');
- if ( is_protected_meta( $meta->meta_key ) )
+ if ( is_protected_meta( $meta->meta_key, 'post' ) || is_protected_meta( $key, 'post' ) ||
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $meta->meta_key ) ||
+ ! current_user_can( 'edit_post_meta', $meta->post_id, $key ) )
die('-1');
- if ( $meta->meta_value != stripslashes($value) || $meta->meta_key != stripslashes($key) ) {
- if ( !$u = update_meta( $mid, $key, $value ) )
+ if ( $meta->meta_value != $value || $meta->meta_key != $key ) {
+ if ( !$u = update_metadata_by_mid( 'post', $mid, $value, $key ) )
die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
}
- $key = stripslashes($key);
- $value = stripslashes($value);
$x = new WP_Ajax_Response( array(
'what' => 'meta',
'id' => $mid, 'old_id' => $mid,
@@ -983,20 +979,23 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
}
$data = $message;
} else {
- if ( isset( $_POST['auto_draft'] ) && '1' == $_POST['auto_draft'] )
+ if ( ! empty( $_POST['auto_draft'] ) )
$id = 0; // This tells us it didn't actually save
else
$id = $post->ID;
}
- if ( $do_lock && ( isset( $_POST['auto_draft'] ) && ( $_POST['auto_draft'] != '1' ) ) && $id && is_numeric($id) )
- wp_set_post_lock( $id );
+ if ( $do_lock && empty( $_POST['auto_draft'] ) && $id && is_numeric( $id ) ) {
+ $lock_result = wp_set_post_lock( $id );
+ $supplemental['active-post-lock'] = implode( ':', $lock_result );
+ }
if ( $nonce_age == 2 ) {
$supplemental['replace-autosavenonce'] = wp_create_nonce('autosave');
$supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink');
$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
+ $supplemental['replace-_ajax_linking_nonce'] = wp_create_nonce( 'internal-linking' );
if ( $id ) {
if ( $_POST['post_type'] == 'post' )
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
@@ -1026,8 +1025,8 @@ case 'closed-postboxes' :
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
- if ( !preg_match( '/^[a-z_-]+$/', $page ) )
- die('-1');
+ if ( $page != sanitize_key( $page ) )
+ die('0');
if ( ! $user = wp_get_current_user() )
die('-1');
@@ -1048,8 +1047,8 @@ case 'hidden-columns' :
$hidden = explode( ',', $_POST['hidden'] );
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
- if ( !preg_match( '/^[a-z_-]+$/', $page ) )
- die('-1');
+ if ( $page != sanitize_key( $page ) )
+ die('0');
if ( ! $user = wp_get_current_user() )
die('-1');
@@ -1057,6 +1056,16 @@ case 'hidden-columns' :
if ( is_array($hidden) )
update_user_option($user->ID, "manage{$page}columnshidden", $hidden, true);
+ die('1');
+ break;
+case 'update-welcome-panel' :
+ check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' );
+
+ if ( ! current_user_can( 'edit_theme_options' ) )
+ die('-1');
+
+ update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 );
+
die('1');
break;
case 'menu-get-metabox' :
@@ -1109,8 +1118,6 @@ case 'menu-quick-search':
exit;
break;
case 'wp-link-ajax':
- require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
-
check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );
$args = array();
@@ -1119,7 +1126,8 @@ case 'wp-link-ajax':
$args['s'] = stripslashes( $_POST['search'] );
$args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
- $results = wp_link_query( $args );
+ require(ABSPATH . WPINC . '/class-wp-editor.php');
+ $results = _WP_Editors::wp_link_query( $args );
if ( ! isset( $results ) )
die( '0' );
@@ -1141,11 +1149,15 @@ case 'menu-locations-save':
case 'meta-box-order':
check_ajax_referer( 'meta-box-order' );
$order = isset( $_POST['order'] ) ? (array) $_POST['order'] : false;
- $page_columns = isset( $_POST['page_columns'] ) ? (int) $_POST['page_columns'] : 0;
+ $page_columns = isset( $_POST['page_columns'] ) ? $_POST['page_columns'] : 'auto';
+
+ if ( $page_columns != 'auto' )
+ $page_columns = (int) $page_columns;
+
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
- if ( !preg_match( '/^[a-z_-]+$/', $page ) )
- die('-1');
+ if ( $page != sanitize_key( $page ) )
+ die('0');
if ( ! $user = wp_get_current_user() )
die('-1');
@@ -1471,8 +1483,10 @@ case 'set-post-thumbnail':
check_ajax_referer( "set_post_thumbnail-$post_ID" );
if ( $thumbnail_id == '-1' ) {
- delete_post_meta( $post_ID, '_thumbnail_id' );
- die( _wp_post_thumbnail_html() );
+ if ( delete_post_thumbnail( $post_ID ) )
+ die( _wp_post_thumbnail_html() );
+ else
+ die( '0' );
}
if ( set_post_thumbnail( $post_ID, $thumbnail_id ) )
@@ -1486,32 +1500,17 @@ case 'time_format' :
die( date_i18n( sanitize_option( 'time_format', $_POST['date'] ) ) );
break;
case 'wp-fullscreen-save-post' :
- if ( isset($_POST['post_ID']) )
- $post_id = (int) $_POST['post_ID'];
- else
- $post_id = 0;
+ $post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
- $post = null;
- $post_type_object = null;
- $post_type = null;
- if ( $post_id ) {
- $post = get_post($post_id);
- if ( $post ) {
- $post_type_object = get_post_type_object($post->post_type);
- if ( $post_type_object ) {
- $post_type = $post->post_type;
- $current_screen->post_type = $post->post_type;
- $current_screen->id = $current_screen->post_type;
- }
- }
- } elseif ( isset($_POST['post_type']) ) {
- $post_type_object = get_post_type_object($_POST['post_type']);
- if ( $post_type_object ) {
- $post_type = $post_type_object->name;
- $current_screen->post_type = $post_type;
- $current_screen->id = $current_screen->post_type;
- }
- }
+ $post = $post_type = null;
+
+ if ( $post_id )
+ $post = get_post( $post_id );
+
+ if ( $post )
+ $post_type = $post->post_type;
+ elseif ( isset( $_POST['post_type'] ) && post_type_exists( $_POST['post_type'] ) )
+ $post_type = $_POST['post_type'];
check_ajax_referer('update-' . $post_type . '_' . $post_id, '_wpnonce');
@@ -1547,6 +1546,43 @@ case 'wp-fullscreen-save-post' :
echo json_encode( array( 'message' => $message, 'last_edited' => $last_edited ) );
die();
break;
+case 'wp-remove-post-lock' :
+ if ( empty( $_POST['post_ID'] ) || empty( $_POST['active_post_lock'] ) )
+ die( '0' );
+ $post_id = (int) $_POST['post_ID'];
+ if ( ! $post = get_post( $post_id ) )
+ die( '0' );
+
+ check_ajax_referer( 'update-' . $post->post_type . '_' . $post_id );
+
+ if ( ! current_user_can( 'edit_post', $post_id ) )
+ die( '-1' );
+
+ $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) );
+ if ( $active_lock[1] != get_current_user_id() )
+ die( '0' );
+
+ $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ) + 5 ) . ':' . $active_lock[1];
+ update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
+ die( '1' );
+case 'dismiss-wp-pointer' :
+ $pointer = $_POST['pointer'];
+ if ( $pointer != sanitize_key( $pointer ) )
+ die( '0' );
+
+// check_ajax_referer( 'dismiss-pointer_' . $pointer );
+
+ $dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );
+
+ if ( in_array( $pointer, $dismissed ) )
+ die( '0' );
+
+ $dismissed[] = $pointer;
+ $dismissed = implode( ',', $dismissed );
+
+ update_user_meta( get_current_user_id(), 'dismissed_wp_pointers', $dismissed );
+ die( '1' );
+ break;
default :
do_action( 'wp_ajax_' . $_POST['action'] );
die('0');
diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php
index 04d73159..02f0db9a 100644
--- a/wp-admin/admin-footer.php
+++ b/wp-admin/admin-footer.php
@@ -21,10 +21,6 @@ if ( !defined('ABSPATH') )
$upgrade = apply_filters( 'update_footer', '' );
$footer_text = array(
'' . __( 'Thank you for creating with WordPress.' ) . '',
- __( 'Documentation' ),
- sprintf( __( 'Freedoms' ), admin_url( 'freedoms.php' ) ),
- __('Feedback'),
- sprintf(__('Credits'), admin_url('credits.php') ),
);
echo apply_filters( 'admin_footer_text', implode( ' • ', $footer_text ) );
unset( $footer_text );
diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index 18b5ff3c..a34a51b8 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -10,6 +10,14 @@
if ( ! defined( 'WP_ADMIN' ) )
require_once( './admin.php' );
+// In case admin-header.php is included in a function.
+global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone,
+ $current_site, $update_title, $total_update_count, $parent_file;
+
+// Catch plugins that include admin-header.php before admin.php completes.
+if ( empty( $current_screen ) )
+ set_current_screen();
+
get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
@@ -29,26 +37,18 @@ $admin_title = apply_filters( 'admin_title', $admin_title, $title );
wp_user_settings();
+_wp_admin_html_begin();
?>
-
- >
-
-
">
-
+
' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '
' .
- '
' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '
' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '
' .
+ '
' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '
'
@@ -66,6 +73,9 @@ case 'editcomment' :
if ( 'trash' == $comment->comment_approved )
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
+ if ( 'spam' == $comment->comment_approved )
+ comment_footer_die( __('This comment is marked as Spam. Please mark it as Not Spam if you want to edit it.') );
+
$comment = get_comment_to_edit( $comment_id );
include('./edit-form-comment.php');
diff --git a/wp-admin/credits.php b/wp-admin/credits.php
index 773053a9..cdc84c7c 100644
--- a/wp-admin/credits.php
+++ b/wp-admin/credits.php
@@ -10,39 +10,6 @@
require_once( './admin.php' );
$title = __( 'Credits' );
-$parent_file = 'index.php';
-
-add_contextual_help($current_screen,
- '
' . __('Each name or handle is a link to that person’s profile in the WordPress.org community directory.') . '
' .
- '
' . __('You can register your own profile at this link to start contributing.') . '
' .
- '
' . __('WordPress always needs more people to report bugs, patch bugs, test betas, work on UI design, translate strings, write documentation, and add questions/answers/suggestions to the Support Forums. Join in!') . '
' . sprintf( __( 'WordPress is created by a worldwide team of passionate individuals. Get involved in WordPress.' ),
'http://wordpress.org/about/',
/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '
' . __( 'WordPress is created by a worldwide team of passionate individuals. We couldn’t possibly list them all, but here some of the most influential people currently involved with the project:' ) . "
\n";
+echo '
' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "
' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '
' .
- '
' . __( 'To use a background image, simply upload it, then choose your display options below. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '
' .
- '
' . __( 'You can also choose a background color. If you know the hexadecimal code for the color you want, enter it in the Color field. If not, click on the Select a Color link, and a color picker will allow you to choose the exact shade you want.' ) . '
' .
- '
' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '
' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '
' .
+ '
' . __( 'To use a background image, simply upload it, then choose your display options below. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '
' .
+ '
' . __( 'You can also choose a background color. If you know the hexadecimal code for the color you want, enter it in the Background Color field. If not, click on the Select a Color link, and a color picker will allow you to choose the exact shade you want.' ) . '
' .
+ '
' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '
diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php
index 24ec9b8b..ebeb2a5a 100644
--- a/wp-admin/custom-header.php
+++ b/wp-admin/custom-header.php
@@ -99,12 +99,20 @@ class Custom_Image_Header {
* @since 3.0.0
*/
function help() {
- add_contextual_help( $this->page, '
' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately.' ) . '
' .
- '
' . __( 'If you want to discard your custom header and go back to the default included in your theme, click on the buttons to remove the custom image and restore the original header image.' ) . '
' .
- '
' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button.' ) . '
' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately.' ) . '
' .
+ '
' . __( 'If you want to discard your custom header and go back to the default included in your theme, click on the buttons to remove the custom image and restore the original header image.' ) . '
' .
+ '
' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button.' ) . '
' . __( 'You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '
' .
- '
' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '
' .
- '
' . __( 'In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '
' .
- '
' . __( 'In the Comment column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '
' .
- '
' . __( 'In the In Response To column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The “#” permalink symbol below leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '
' .
- '
' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '
' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '
' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '
' .
+ '
' . __( 'In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '
' .
+ '
' . __( 'In the Comment column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '
' .
+ '
' . __( 'In the In Response To column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '
' .
+ '
' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '
' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '
' .
- '
' . __('Title - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '
' .
- '
' . __('Post editor - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions. You can go the distraction-free writing screen, new in 3.2, via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '
' .
- '
' . __('Publish - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '
' . __( 'Post Format - This designates how your theme will display a specific post. For example, you could have a standard blog post with a title and paragraphs, or a short aside that omits the title and contains a short text blurb. Please refer to the Codex for descriptions of each post format. Your theme could enable all or some of 10 possible formats.' ) . '
' : '' ) .
- '
' . __('Featured Image - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '
' .
- '
' . __('Send Trackbacks - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '
' .
- '
' . __('Discussion - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '
' .
- '
' . sprintf(__('You can also create posts with the Press This bookmarklet.'), 'options-writing.php') . '
' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '
' . __('Title - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '
';
+ $title_and_editor .= '
' . __('Post editor - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in HTML mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '
' . __('Publish - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '
' . __( 'Post Format - This designates how your theme will display a specific post. For example, you could have a standard blog post with a title and paragraphs, or a short aside that omits the title and contains a short text blurb. Please refer to the Codex for descriptions of each post format. Your theme could enable all or some of 10 possible formats.' ) . '
' . __('Featured Image - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '
' . __('Send Trackbacks - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '
';
+ $discussion_settings .= '
' . __('Discussion - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '
' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '
' .
- '
' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the new in 3.2 distraction-free writing space, available in both the Visual and HTML modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '
' .
- '
' . __('Parent - You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '
' .
- '
' . __('Template - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '
' .
- '
' . __('Order - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '
' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '
' .
+ '
' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and HTML modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '
' . __('Parent - You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '
' .
+ '
' . __('Template - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '
' .
+ '
' . __('Order - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '
";
- if ( !empty($wp_registered_sidebars) ) {
+
+ if ( empty( $ct->stylesheet_dir ) ) {
+ if ( ! is_multisite() || is_super_admin() )
+ echo '' . __('ERROR: The themes directory is either empty or doesn’t exist. Please check your installation.') . '';
+ } elseif ( ! empty($wp_registered_sidebars) ) {
$sidebars_widgets = wp_get_sidebars_widgets();
$num_widgets = 0;
foreach ( (array) $sidebars_widgets as $k => $v ) {
@@ -531,8 +535,8 @@ function wp_dashboard_quick_press() {
-
-
+
+
@@ -550,7 +554,7 @@ function wp_dashboard_quick_press() {
-
+
'save-post', 'tabindex'=> 4 ) ); ?>
@@ -1023,7 +1027,7 @@ function wp_dashboard_plugins_output() {
* Checks to see if all of the feed url in $check_urls are cached.
*
* If $check_urls is empty, look for the rss feed url found in the dashboard
- * widget optios of $widget_id. If cached, call $callback, a function that
+ * widget options of $widget_id. If cached, call $callback, a function that
* echoes out output for this widget. If not cache, echo a "Loading..." stub
* which is later replaced by AJAX call (see top of /wp-admin/index.php)
*
@@ -1189,7 +1193,7 @@ function wp_dashboard_browser_nag() {
$browser_nag_class = ' has-browser-icon';
}
$notice .= "
';
$notice .= '';
}
@@ -1259,4 +1263,101 @@ function wp_check_browser_version() {
*/
function wp_dashboard_empty() {}
+/**
+ * Displays a welcome panel to introduce users to WordPress.
+ *
+ * @since 3.3
+ */
+function wp_welcome_panel() {
+ global $wp_version;
+
+ if ( ! current_user_can( 'edit_theme_options' ) )
+ return;
+
+ $classes = 'welcome-panel';
+
+ $option = get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
+ // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
+ $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( 'admin_email' ) );
+ if ( $hide )
+ $classes .= ' hidden';
+
+ list( $display_version ) = explode( '-', $wp_version );
+ ?>
+
+
+
+
+
+
+
+
First Steps with WordPress. If you’d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?>
+
+
+
+
+
+
Choose your privacy setting' ), esc_url( admin_url('options-privacy.php') ) ); ?>
+
Select your tagline and time zone' ), esc_url( admin_url('options-general.php') ) ); ?>
+
Turn comments on or off' ), esc_url( admin_url('options-discussion.php') ) ); ?>
+
Fill in your profile' ), esc_url( admin_url('profile.php') ) ); ?>
';
+ printf( __( 'Use the current theme — %1$s — or choose a new one. If you stick with %3$s, here are a few ways to make your site look unique.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ), $ct->title );
+ echo '
';
+ ?>
+
+
+
+
+
+ ';
+ printf( __( 'Use the current theme — %1$s — or choose a new one.' ), $ct->title, esc_url( admin_url( 'themes.php' ) ) );
+ echo '';
+ }
+ endif; ?>
+
@@ -466,7 +441,7 @@ function list_meta( $meta ) {
function _list_meta_row( $entry, &$count ) {
static $update_nonce = false;
- if ( is_protected_meta( $entry['meta_key'] ) )
+ if ( is_protected_meta( $entry['meta_key'], 'post' ) )
return;
if ( !$update_nonce )
@@ -478,8 +453,6 @@ function _list_meta_row( $entry, &$count ) {
$style = 'alternate';
else
$style = '';
- if ('_' == $entry['meta_key'] { 0 } )
- $style .= ' hidden';
if ( is_serialized( $entry['meta_value'] ) ) {
if ( is_serialized_string( $entry['meta_value'] ) ) {
@@ -613,10 +586,11 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$month = "';
@@ -865,13 +839,20 @@ function wp_import_upload_form( $action ) {
* @param string $id String for use in the 'id' attribute of tags.
* @param string $title Title of the meta box.
* @param string $callback Function that fills the box with the desired content. The function should echo its output.
- * @param string $page The type of edit page on which to show the box (post, page, link).
- * @param string $context The context within the page where the boxes should show ('normal', 'advanced').
- * @param string $priority The priority within the context where the boxes should show ('high', 'low').
+ * @param string|object $screen Optional. The screen on which to show the box (post, page, link). Defaults to current screen.
+ * @param string $context Optional. The context within the page where the boxes should show ('normal', 'advanced').
+ * @param string $priority Optional. The priority within the context where the boxes should show ('high', 'low').
*/
-function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args=null) {
+function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
global $wp_meta_boxes;
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
if ( !isset($wp_meta_boxes) )
$wp_meta_boxes = array();
if ( !isset($wp_meta_boxes[$page]) )
@@ -899,7 +880,7 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
// If no priority given and id already present, use existing priority
if ( empty($priority) ) {
$priority = $a_priority;
- // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
+ // else if we're adding to the sorted priority, we don't know the title or callback. Grab them from the previously added context/priority.
} elseif ( 'sorted' == $priority ) {
$title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
$callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
@@ -925,16 +906,23 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri
*
* @since 2.5.0
*
- * @param string $page page identifier, also known as screen identifier
+ * @param string|object $screen Screen identifier
* @param string $context box context
* @param mixed $object gets passed to the box callback function as first parameter
* @return int number of meta_boxes
*/
-function do_meta_boxes($page, $context, $object) {
+function do_meta_boxes( $screen, $context, $object ) {
global $wp_meta_boxes;
static $already_sorted = false;
- $hidden = get_hidden_meta_boxes($page);
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
+ $hidden = get_hidden_meta_boxes( $screen );
printf('
', htmlspecialchars($context));
@@ -945,7 +933,7 @@ function do_meta_boxes($page, $context, $object) {
foreach ( $sorted as $box_context => $ids ) {
foreach ( explode(',', $ids ) as $id ) {
if ( $id && 'dashboard_browser_nag' !== $id )
- add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
+ add_meta_box( $id, null, null, $screen, $box_context, 'sorted' );
}
}
}
@@ -987,12 +975,19 @@ function do_meta_boxes($page, $context, $object) {
* @since 2.6.0
*
* @param string $id String for use in the 'id' attribute of tags.
- * @param string $page The type of edit page on which to show the box (post, page, link).
+ * @param string|object $screen The screen on which to show the box (post, page, link).
* @param string $context The context within the page where the boxes should show ('normal', 'advanced').
*/
-function remove_meta_box($id, $page, $context) {
+function remove_meta_box($id, $screen, $context) {
global $wp_meta_boxes;
+ if ( empty( $screen ) )
+ $screen = get_current_screen();
+ elseif ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $page = $screen->id;
+
if ( !isset($wp_meta_boxes) )
$wp_meta_boxes = array();
if ( !isset($wp_meta_boxes[$page]) )
@@ -1004,67 +999,6 @@ function remove_meta_box($id, $page, $context) {
$wp_meta_boxes[$page][$context][$priority][$id] = false;
}
-/**
- * {@internal Missing Short Description}}
- *
- * @since 2.7.0
- *
- * @param unknown_type $screen
- */
-function meta_box_prefs($screen) {
- global $wp_meta_boxes;
-
- if ( is_string($screen) )
- $screen = convert_to_screen($screen);
-
- if ( empty($wp_meta_boxes[$screen->id]) )
- return;
-
- $hidden = get_hidden_meta_boxes($screen);
-
- foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {
- foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {
- foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {
- if ( false == $box || ! $box['title'] )
- continue;
- // Submit box cannot be hidden
- if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )
- continue;
- $box_id = $box['id'];
- echo '\n";
- }
- }
- }
-}
-
-/**
- * Get Hidden Meta Boxes
- *
- * @since 2.7.0
- *
- * @param string|object $screen Screen identifier
- * @return array Hidden Meta Boxes
- */
-function get_hidden_meta_boxes( $screen ) {
- if ( is_string( $screen ) )
- $screen = convert_to_screen( $screen );
-
- $hidden = get_user_option( "metaboxhidden_{$screen->id}" );
-
- // Hide slug boxes by default
- if ( !is_array( $hidden ) ) {
- if ( 'post' == $screen->base || 'page' == $screen->base )
- $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
- else
- $hidden = array( 'slugdiv' );
- $hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen);
- }
-
- return $hidden;
-}
-
/**
* Add a new section to a settings page.
*
@@ -1111,7 +1045,7 @@ function add_settings_section($id, $title, $callback, $page) {
* do_settings_fields() in do_settings-sections()
*
* The $callback argument should be the name of a function that echoes out the
- * html input tags for this setting field. Use get_option() to retrive existing
+ * html input tags for this setting field. Use get_option() to retrieve existing
* values to show.
*
* @since 2.7.0
@@ -1122,7 +1056,7 @@ function add_settings_section($id, $title, $callback, $page) {
* @param string $title Formatted title of the field. Shown as the label for the field during output.
* @param string $callback Function that fills the field with the desired form inputs. The function should echo its output.
* @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...).
- * @param string $section The slug-name of the section of the settingss page in which to show the box (default, ...).
+ * @param string $section The slug-name of the section of the settings page in which to show the box (default, ...).
* @param array $args Additional arguments
*/
function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
@@ -1163,7 +1097,8 @@ function do_settings_sections($page) {
return;
foreach ( (array) $wp_settings_sections[$page] as $section ) {
- echo "
' . esc_js( __( 'We’ve combined the admin bar and the old Dashboard header into one persistent toolbar. Hover over the toolbar items to see what’s new.' ) ) . '
' . esc_js( __( 'The single media icon now launches the uploader for all file types, and the new drag and drop interface makes uploading a breeze.' ) ) . '
";
-
- // For every field line specified in the query
- foreach ($flds as $fld) {
- // Extract the field name
- preg_match("|^([^ ]*)|", trim($fld), $fvals);
- $fieldname = trim( $fvals[1], '`' );
-
- // Verify the found field name
- $validfield = true;
- switch (strtolower($fieldname)) {
- case '':
- case 'primary':
- case 'index':
- case 'fulltext':
- case 'unique':
- case 'key':
- $validfield = false;
- $indices[] = trim(trim($fld), ", \n");
- break;
- }
- $fld = trim($fld);
+ // Fetch the table column structure from the database
+ $wpdb->suppress_errors();
+ $tablefields = $wpdb->get_results("DESCRIBE {$table};");
+ $wpdb->suppress_errors( false );
- // If it's a valid field, add it to the field array
- if ($validfield) {
- $cfields[strtolower($fieldname)] = trim($fld, ", \n");
- }
+ if ( ! $tablefields )
+ continue;
+
+ // Clear the field and index arrays
+ $cfields = $indices = array();
+ // Get all of the field names in the query from between the parens
+ preg_match("|\((.*)\)|ms", $qry, $match2);
+ $qryline = trim($match2[1]);
+
+ // Separate field lines into an array
+ $flds = explode("\n", $qryline);
+
+ //echo "
";
+
+ // For every field line specified in the query
+ foreach ($flds as $fld) {
+ // Extract the field name
+ preg_match("|^([^ ]*)|", trim($fld), $fvals);
+ $fieldname = trim( $fvals[1], '`' );
+
+ // Verify the found field name
+ $validfield = true;
+ switch (strtolower($fieldname)) {
+ case '':
+ case 'primary':
+ case 'index':
+ case 'fulltext':
+ case 'unique':
+ case 'key':
+ $validfield = false;
+ $indices[] = trim(trim($fld), ", \n");
+ break;
+ }
+ $fld = trim($fld);
+
+ // If it's a valid field, add it to the field array
+ if ($validfield) {
+ $cfields[strtolower($fieldname)] = trim($fld, ", \n");
+ }
+ }
+
+ // For every field in the table
+ foreach ($tablefields as $tablefield) {
+ // If the table field exists in the field array...
+ if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
+ // Get the field type from the query
+ preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
+ $fieldtype = $matches[1];
+
+ // Is actual field type different from the field type in query?
+ if ($tablefield->Type != $fieldtype) {
+ // Add a query to change the column type
+ $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
+ $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
}
- // Fetch the table column structure from the database
- $tablefields = $wpdb->get_results("DESCRIBE {$table};");
-
- // For every field in the table
- foreach ($tablefields as $tablefield) {
- // If the table field exists in the field array...
- if (array_key_exists(strtolower($tablefield->Field), $cfields)) {
- // Get the field type from the query
- preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
- $fieldtype = $matches[1];
-
- // Is actual field type different from the field type in query?
- if ($tablefield->Type != $fieldtype) {
- // Add a query to change the column type
- $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
- $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
- }
-
- // Get the default value from the array
- //echo "{$cfields[strtolower($tablefield->Field)]} ";
- if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
- $default_value = $matches[1];
- if ($tablefield->Default != $default_value) {
- // Add a query to change the column's default value
- $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'";
- $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
- }
- }
-
- // Remove the field from the array (so it's not added)
- unset($cfields[strtolower($tablefield->Field)]);
- } else {
- // This field exists in the table, but not in the creation queries?
+ // Get the default value from the array
+ //echo "{$cfields[strtolower($tablefield->Field)]} ";
+ if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
+ $default_value = $matches[1];
+ if ($tablefield->Default != $default_value) {
+ // Add a query to change the column's default value
+ $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'";
+ $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
}
}
- // For every remaining field specified for the table
- foreach ($cfields as $fieldname => $fielddef) {
- // Push a query line into $cqueries that adds the field to that table
- $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
- $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname;
- }
+ // Remove the field from the array (so it's not added)
+ unset($cfields[strtolower($tablefield->Field)]);
+ } else {
+ // This field exists in the table, but not in the creation queries?
+ }
+ }
- // Index stuff goes here
- // Fetch the table index structure from the database
- $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");
+ // For every remaining field specified for the table
+ foreach ($cfields as $fieldname => $fielddef) {
+ // Push a query line into $cqueries that adds the field to that table
+ $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
+ $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname;
+ }
- if ($tableindices) {
- // Clear the index array
- unset($index_ary);
+ // Index stuff goes here
+ // Fetch the table index structure from the database
+ $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");
- // For every index in the table
- foreach ($tableindices as $tableindex) {
- // Add the index to the index data array
- $keyname = $tableindex->Key_name;
- $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
- $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
- }
+ if ($tableindices) {
+ // Clear the index array
+ unset($index_ary);
+
+ // For every index in the table
+ foreach ($tableindices as $tableindex) {
+ // Add the index to the index data array
+ $keyname = $tableindex->Key_name;
+ $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
+ $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
+ }
- // For each actual index in the index array
- foreach ($index_ary as $index_name => $index_data) {
- // Build a create string to compare to the query
- $index_string = '';
- if ($index_name == 'PRIMARY') {
- $index_string .= 'PRIMARY ';
- } else if($index_data['unique']) {
- $index_string .= 'UNIQUE ';
- }
- $index_string .= 'KEY ';
- if ($index_name != 'PRIMARY') {
- $index_string .= $index_name;
- }
- $index_columns = '';
- // For each column in the index
- foreach ($index_data['columns'] as $column_data) {
- if ($index_columns != '') $index_columns .= ',';
- // Add the field to the column list string
- $index_columns .= $column_data['fieldname'];
- if ($column_data['subpart'] != '') {
- $index_columns .= '('.$column_data['subpart'].')';
- }
- }
- // Add the column list to the index create string
- $index_string .= ' ('.$index_columns.')';
- if (!(($aindex = array_search($index_string, $indices)) === false)) {
- unset($indices[$aindex]);
- //echo "
{$table}: Found index:".$index_string."
\n";
- }
- //else echo "
{$table}: Did not find index:".$index_string." ".print_r($indices, true)."
\n";
+ // For each actual index in the index array
+ foreach ($index_ary as $index_name => $index_data) {
+ // Build a create string to compare to the query
+ $index_string = '';
+ if ($index_name == 'PRIMARY') {
+ $index_string .= 'PRIMARY ';
+ } else if($index_data['unique']) {
+ $index_string .= 'UNIQUE ';
+ }
+ $index_string .= 'KEY ';
+ if ($index_name != 'PRIMARY') {
+ $index_string .= $index_name;
+ }
+ $index_columns = '';
+ // For each column in the index
+ foreach ($index_data['columns'] as $column_data) {
+ if ($index_columns != '') $index_columns .= ',';
+ // Add the field to the column list string
+ $index_columns .= $column_data['fieldname'];
+ if ($column_data['subpart'] != '') {
+ $index_columns .= '('.$column_data['subpart'].')';
}
}
-
- // For every remaining index specified for the table
- foreach ( (array) $indices as $index ) {
- // Push a query line into $cqueries that adds the index to that table
- $cqueries[] = "ALTER TABLE {$table} ADD $index";
- $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
+ // Add the column list to the index create string
+ $index_string .= ' ('.$index_columns.')';
+ if (!(($aindex = array_search($index_string, $indices)) === false)) {
+ unset($indices[$aindex]);
+ //echo "
{$table}: Found index:".$index_string."
\n";
}
-
- // Remove the original table creation query from processing
- unset($cqueries[strtolower($table)]);
- unset($for_update[strtolower($table)]);
- } else {
- // This table exists in the database, but not in the creation queries?
+ //else echo "
{$table}: Did not find index:".$index_string." ".print_r($indices, true)."
\n";
}
}
+
+ // For every remaining index specified for the table
+ foreach ( (array) $indices as $index ) {
+ // Push a query line into $cqueries that adds the index to that table
+ $cqueries[] = "ALTER TABLE {$table} ADD $index";
+ $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
+ }
+
+ // Remove the original table creation query from processing
+ unset( $cqueries[ $table ], $for_update[ $table ] );
}
$allqueries = array_merge($cqueries, $iqueries);
@@ -1577,10 +1653,8 @@ function dbDelta($queries, $execute = true) {
*
* @since 1.5.0
*/
-function make_db_current() {
- global $wp_queries;
-
- $alterations = dbDelta($wp_queries);
+function make_db_current( $tables = 'all' ) {
+ $alterations = dbDelta( $tables );
echo "\n";
foreach($alterations as $alteration) echo "
$alteration
\n";
echo "\n";
@@ -1593,10 +1667,8 @@ function make_db_current() {
*
* @since 1.5.0
*/
-function make_db_current_silent() {
- global $wp_queries;
-
- $alterations = dbDelta($wp_queries);
+function make_db_current_silent( $tables = 'all' ) {
+ $alterations = dbDelta( $tables );
}
/**
@@ -1618,7 +1690,7 @@ function make_site_theme_from_oldschool($theme_name, $template) {
return false;
// Copy files from the old locations to the site theme.
- // TODO: This does not copy arbitarary include dependencies. Only the
+ // TODO: This does not copy arbitrary include dependencies. Only the
// standard WP files are copied.
$files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php');
@@ -1878,102 +1950,6 @@ function pre_schema_upgrade() {
}
-/**
- * Install Network.
- *
- * @since 3.0.0
- *
- */
-if ( !function_exists( 'install_network' ) ) :
-function install_network() {
- global $wpdb, $charset_collate;
- $ms_queries = "
-CREATE TABLE $wpdb->users (
- ID bigint(20) unsigned NOT NULL auto_increment,
- user_login varchar(60) NOT NULL default '',
- user_pass varchar(64) NOT NULL default '',
- user_nicename varchar(50) NOT NULL default '',
- user_email varchar(100) NOT NULL default '',
- user_url varchar(100) NOT NULL default '',
- user_registered datetime NOT NULL default '0000-00-00 00:00:00',
- user_activation_key varchar(60) NOT NULL default '',
- user_status int(11) NOT NULL default '0',
- display_name varchar(250) NOT NULL default '',
- spam tinyint(2) NOT NULL default '0',
- deleted tinyint(2) NOT NULL default '0',
- PRIMARY KEY (ID),
- KEY user_login_key (user_login),
- KEY user_nicename (user_nicename)
-) $charset_collate;
-CREATE TABLE $wpdb->blogs (
- blog_id bigint(20) NOT NULL auto_increment,
- site_id bigint(20) NOT NULL default '0',
- domain varchar(200) NOT NULL default '',
- path varchar(100) NOT NULL default '',
- registered datetime NOT NULL default '0000-00-00 00:00:00',
- last_updated datetime NOT NULL default '0000-00-00 00:00:00',
- public tinyint(2) NOT NULL default '1',
- archived enum('0','1') NOT NULL default '0',
- mature tinyint(2) NOT NULL default '0',
- spam tinyint(2) NOT NULL default '0',
- deleted tinyint(2) NOT NULL default '0',
- lang_id int(11) NOT NULL default '0',
- PRIMARY KEY (blog_id),
- KEY domain (domain(50),path(5)),
- KEY lang_id (lang_id)
-) $charset_collate;
-CREATE TABLE $wpdb->blog_versions (
- blog_id bigint(20) NOT NULL default '0',
- db_version varchar(20) NOT NULL default '',
- last_updated datetime NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (blog_id),
- KEY db_version (db_version)
-) $charset_collate;
-CREATE TABLE $wpdb->registration_log (
- ID bigint(20) NOT NULL auto_increment,
- email varchar(255) NOT NULL default '',
- IP varchar(30) NOT NULL default '',
- blog_id bigint(20) NOT NULL default '0',
- date_registered datetime NOT NULL default '0000-00-00 00:00:00',
- PRIMARY KEY (ID),
- KEY IP (IP)
-) $charset_collate;
-CREATE TABLE $wpdb->site (
- id bigint(20) NOT NULL auto_increment,
- domain varchar(200) NOT NULL default '',
- path varchar(100) NOT NULL default '',
- PRIMARY KEY (id),
- KEY domain (domain,path)
-) $charset_collate;
-CREATE TABLE $wpdb->sitemeta (
- meta_id bigint(20) NOT NULL auto_increment,
- site_id bigint(20) NOT NULL default '0',
- meta_key varchar(255) default NULL,
- meta_value longtext,
- PRIMARY KEY (meta_id),
- KEY meta_key (meta_key),
- KEY site_id (site_id)
-) $charset_collate;
-CREATE TABLE $wpdb->signups (
- domain varchar(200) NOT NULL default '',
- path varchar(100) NOT NULL default '',
- title longtext NOT NULL,
- user_login varchar(60) NOT NULL default '',
- user_email varchar(100) NOT NULL default '',
- registered datetime NOT NULL default '0000-00-00 00:00:00',
- activated datetime NOT NULL default '0000-00-00 00:00:00',
- active tinyint(1) NOT NULL default '0',
- activation_key varchar(50) NOT NULL default '',
- meta longtext,
- KEY activation_key (activation_key),
- KEY domain (domain)
-) $charset_collate;
-";
-// now create tables
- dbDelta( $ms_queries );
-}
-endif;
-
/**
* Install global terms.
*
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 758c065a..816a9e79 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -119,7 +119,6 @@ function edit_user( $user_id = 0 ) {
$user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
$user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
$user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
- $user->show_admin_bar_admin = isset( $_POST['admin_bar_admin'] ) ? 'true' : 'false';
}
$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
@@ -196,7 +195,7 @@ function edit_user( $user_id = 0 ) {
*
* Simple function who's main purpose is to allow filtering of the
* list of roles in the $wp_roles object so that plugins can remove
- * innappropriate ones depending on the situation or user making edits.
+ * inappropriate ones depending on the situation or user making edits.
* Specifically because without filtering anyone with the edit_users
* capability can edit others to be administrators, even if they are
* only editors or authors. This filter allows admins to delegate
@@ -226,16 +225,7 @@ function get_editable_roles() {
function get_user_to_edit( $user_id ) {
$user = new WP_User( $user_id );
- $user_contactmethods = _wp_get_user_contactmethods( $user );
- foreach ($user_contactmethods as $method => $name) {
- if ( empty( $user->{$method} ) )
- $user->{$method} = '';
- }
-
- if ( empty($user->description) )
- $user->description = '';
-
- $user = sanitize_user_object($user, 'edit');
+ $user->filter = 'edit';
return $user;
}
@@ -338,7 +328,7 @@ function default_password_nag_handler($errors = false) {
if ( ! get_user_option('default_password_nag') ) //Short circuit it.
return;
- //get_user_setting = JS saved UI setting. else no-js-falback code.
+ //get_user_setting = JS saved UI setting. else no-js-fallback code.
if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {
delete_user_setting('default_password_nag');
update_user_option($user_ID, 'default_password_nag', false, true);
diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php
index 6b7d6351..aed12360 100644
--- a/wp-admin/includes/widgets.php
+++ b/wp-admin/includes/widgets.php
@@ -160,7 +160,7 @@ function wp_widget_control( $sidebar_args ) {
$query_arg['key'] = $key;
}
- // We aren't showing a widget control, we're outputing a template for a mult-widget control
+ // We aren't showing a widget control, we're outputting a template for a multi-widget control
if ( isset($sidebar_args['_display']) && 'template' == $sidebar_args['_display'] && $widget_number ) {
// number == -1 implies a template where id numbers are replaced by a generic '__i__'
$control['params'][0]['number'] = -1;
diff --git a/wp-admin/index.php b/wp-admin/index.php
index 35b041de..b7b40bb8 100644
--- a/wp-admin/index.php
+++ b/wp-admin/index.php
@@ -17,8 +17,6 @@ wp_dashboard_setup();
wp_enqueue_script( 'dashboard' );
wp_enqueue_script( 'plugin-install' );
wp_enqueue_script( 'media-upload' );
-wp_admin_css( 'dashboard' );
-wp_admin_css( 'plugin-install' );
add_thickbox();
$title = __('Dashboard');
@@ -29,21 +27,56 @@ if ( is_user_admin() )
else
add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
-add_contextual_help($current_screen,
-
- '
' . __( 'Welcome to your WordPress Dashboard! You will find helpful tips in the Help tab of each screen to assist you as you get to know the application.' ) . '
' .
- '
' . __( 'The Admin Bar at the top provides quick access to common tasks when you are viewing your site. If you miss the Favorite Actions dropdown, removed as of 3.2, you can find many of the same actions in the Admin Bar, such as Add New > Post.' ) . '
' .
- '
' . __( 'The left-hand navigation menu provides links to the administration screens in your WordPress application. You can expand or collapse navigation sections by clicking on the arrow that appears on the right side of each navigation item when you hover over it. You can also minimize the navigation menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom of the nav menu, below Settings; when minimized, the submenu items will be displayed on hover.' ) . '
' .
- '
' . __( 'You can arrange your dashboard by choosing which boxes, or modules, to display in the work area, how many columns to display them in, and where each box should be placed. You can hide/show boxes and select the number of columns in the Screen Options tab. To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box. You can also expand or collapse each box; click the title area or downward arrow of the box. In addition, some boxes are configurable, and will show a “Configure” link in the title bar if you hover over it.' ) . '
' .
- '
' . __( 'The boxes on your Dashboard screen are:' ) . '
' .
- '
' . __( 'Right Now - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
' .
- '
' . __( 'Recent Comments - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.' ) . '
' .
- '
' . __( 'Incoming Links - Shows links to your site found by Google Blog Search.' ) . '
' .
- '
' . __( 'QuickPress - Allows you to create a new post and either publish it or save it as a draft.' ) . '
' .
- '
' . __( 'Recent Drafts - Displays links to the 5 most recent draft posts you’ve started.' ) . '
' .
- '
' . __( 'WordPress Blog - Come here for the latest scoop.' ) . '
' .
- '
' . __( 'Other WordPress News - Shows the feed from WordPress Planet. You can configure it to show a different feed of your choosing.' ) . '
' .
- '
' . __( 'Plugins - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.' ) . '
' .
+
+$help = '
' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.' ) . '
' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '
';
+$help .= '
' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '
' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '
';
+$help .= '
' . __('Screen Options - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '
';
+$help .= '
' . __('Drag and Drop - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '
';
+$help .= '
' . __('Box Controls - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.') . '