diff --git a/readme.html b/readme.html index c44623c..e29c092 100644 --- a/readme.html +++ b/readme.html @@ -9,7 +9,7 @@
- Semantic Personal Publishing Platform
diff --git a/wp-admin/about.php b/wp-admin/about.php index 8105de9..8118b5a 100644 --- a/wp-admin/about.php +++ b/wp-admin/about.php @@ -21,141 +21,163 @@ $title = __( 'About' ); list( $display_version ) = explode( '-', $wp_version ); include( ABSPATH . 'wp-admin/admin-header.php' ); + +$video_url = 'https://videopress.com/embed/T54Iy7Tw'; +$locale = str_replace( '_', '-', get_locale() ); +if ( 'en-AU' !== $locale ) { + list( $locale ) = explode( '-', $locale ); +} +if ( 'en' !== $locale ) { + $video_url = add_query_arg( 'defaultLangCode', $locale, $video_url ); +} + +$major_features = array( + array( + 'src' => array( + 'mp4' => '//s.w.org/images/core/4.3/formatting.mp4', + 'ogv' => '//s.w.org/images/core/4.3/formatting.ogv', + 'webm' => '//s.w.org/images/core/4.3/formatting.webm', + ), + 'heading' => __( 'Formatting Shortcuts' ), + /* Translators: 1: asterisks; 2: number sign; */ + 'description' => sprintf( __( 'Your writing flow just got faster with new formatting shortcuts in WordPress 4.3. Use asterisks to create lists and number signs to make a heading. No more breaking your flow; your text looks great with a %1$s and a %2$s.' ), '*', '#' ),
+ ),
+ array(
+ 'src' => '//s.w.org/images/core/4.3/menu-customizer.png',
+ 'heading' => __( 'Menus in the Customizer' ),
+ 'description' => __( 'Create your menu, update it, and assign it, all while live-previewing in the customizer. The streamlined customizer design provides a mobile-friendly and accessible interface. With every release, it becomes easier and faster to make your site just the way you want it.' ),
+ ),
+ array(
+ 'src' => '//s.w.org/images/core/4.3/better-passwords.png',
+ 'heading' => __( 'Better Passwords' ),
+ 'description' => __( 'Keep your site more secure with WordPress’ improved approach to passwords. Instead of receiving passwords via email, you’ll get a password reset link. When you add new users to your site or edit a user profile, WordPress will automatically generate a secure password.' ),
+ ),
+ array(
+ 'src' => '//s.w.org/images/core/4.3/site-icon-customizer.png',
+ 'heading' => __( 'Site Icons' ),
+ 'description' => __( 'Site icons represent your site in browser tabs, bookmark menus, and on the home screen of mobile devices. Add your unique site icon in the customizer; it will even stay in place when you switch themes. Make your whole site reflect your brand.' ),
+ ),
+);
+shuffle( $major_features );
+
+$minor_features = array(
+ array(
+ 'src' => 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjMDBhMGQyIiBkPSJNNTAgMjE1aDI0MHYzMEg1MHpNNTAgMjc1aDI0MHYzMEg1MHpNNTAgMTU1aDI0MHYzMEg1MHpNNTAgOTVoMjQwdjMwSDUwek0zMTAuMSA5NWwxOS45IDMwIDIwLjEtMzAiLz48L3N2Zz4=',
+ 'heading' => __( 'A smoother admin experience' ),
+ 'description' => __( 'Refinements to the list view across the admin make your WordPress more accessible and easier to work with on any device.' ),
+ ),
+ array(
+ 'src' => 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iIzAwYTBkMiIgZD0iTTUgMmgxMHEuODIgMCAxLjQxLjU5VDE3IDR2OHEwIC44Mi0uNTkgMS40MVQxNSAxNGgtMmwtNSA1di01SDVxLS44MiAwLTEuNDEtLjU5VDMgMTJWNHEwLS44Mi41OS0xLjQxVDUgMnptOC41IDguNUwxMSA4bDIuNS0yLjUtMS0xTDEwIDcgNy41IDQuNWwtMSAxTDkgOGwtMi41IDIuNSAxIDFMMTAgOWwyLjUgMi41eiIvPjwvc3ZnPg==',
+ 'heading' => __( 'Comments turned off on pages' ),
+ 'description' => __( 'All new pages that you create will have comments turned off. Keep discussions to your blog, right where they’re supposed to happen.' ),
+ ),
+ array(
+ 'src' => 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHBhdGggZmlsbD0iIzAwYTBkMiIgZD0iTTI5LjMyOCA1LjcxMnEuMDQ4LS4xNDQuMDk2LS4zODR0LS4wNjQtLjgxNi0uNTI4LS45NzZxLS4zODQtLjM2OC0uODcyLS40NjR0LS43OTIgMGwtLjI4OC4wOHEtMS40NTYuNzItNS44OCAzLjczNnQtNi4zOTIgNS4xNzZxLS43MzYuODMyLTEuNDA4IDIuMzJ0LS44OCAzIC41NDQgMi4zOTJxLjgzMi43MzYgMi4zNDQuNTc2dDMuMDcyLS44MjQgMi4yNDgtMS4zNTJxMi4xNDQtMi4xNDQgNS4xNjgtNi42NTZ0My42MzItNS44MDh6TTIuMjQgMjguMjRxMS4wNTYtLjY4OCAxLjcxMi0xLjUyOHQuOTUyLTEuNjE2LjU0NC0xLjUyLjcyLTEuNDggMS4yNC0xLjI4cTEuMDg4LS44IDIuNTA0LS43MDR0Mi40MjQgMS4xNjhxLjgxNi44OC44MjQgMi42NHQtMS4wOCAyLjg5NnEtMS4yMTYgMS4xMi0yLjkwNCAxLjYyNHQtMy40MjQuNDI0LTMuNTEyLS42MjR6Ii8+PC9zdmc+',
+ 'heading' => __( 'Customize your site quickly' ),
+ 'description' => __( 'Wherever you are on the front-end, you can click the customize link in the toolbar to swiftly make changes to your site.' ),
+ ),
+);
+
+$tech_features = array(
+ array(
+ 'heading' => __( 'Taxonomy Roadmap' ),
+ 'description' => __( 'Terms shared across multiple taxonomies are now split into separate terms.' ),
+ ),
+ array(
+ 'heading' => __( 'Template Hierarchy' ),
+ /* Translators: 1: singular.php; 2: single.php; 3:page.php */
+ 'description' => sprintf( __( 'Added %1$s as a fallback for %2$s and %3$s' ), 'singular.php', 'single.php', 'page.php.' ),
+ ),
+ array(
+ 'heading' => 'WP_List_Table',
+ 'description' => __( 'List tables can and should designate a primary column.' ),
+ ),
+);
+
?>
-Version %1$s addressed some security issues and fixed %2$s bug.', - 'Version %1$s addressed some security issues and fixed %2$s bugs.', 4 ), '4.2.4', number_format_i18n( 4 ) ); ?> - the release notes.' ), 'http://codex.wordpress.org/Version_4.2.4' ); ?> -
-Version %1$s addressed some security issues and fixed %2$s bug.', - 'Version %1$s addressed some security issues and fixed %2$s bugs.', 20 ), '4.2.3', number_format_i18n( 20 ) ); ?> - the release notes.' ), 'http://codex.wordpress.org/Version_4.2.3' ); ?> -
-Version %1$s addressed some security issues and fixed %2$s bug.', - 'Version %1$s addressed some security issues and fixed %2$s bugs.', 13 ), '4.2.2', number_format_i18n( 13 ) ); ?> - the release notes.' ), 'http://codex.wordpress.org/Version_4.2.2' ); ?> -
-Version %1$s addressed a security issue.', - 'Version %1$s addressed some security issues.', 1 ), '4.2.1' ); ?> - the release notes.' ), 'http://codex.wordpress.org/Version_4.2.1' ); ?> -
-Tools menu, add Press This to your browser bookmark bar or your mobile device home screen. Once installed you can share your content with lightning speed. Sharing your favorite videos, images, and content has never been this fast or this easy.' ), admin_url( 'tools.php' ) ); ?>
- - - -
-
- emoji.' ), '💙', '🐸', '🐒', '🍕', __( 'https://codex.wordpress.org/Emoji' ) ); - ?>
-
-
- your content, before it debuts on your site. ' ); ?>
-
-
-
-
-
- Update Now and watch the magic happen.' ); ?>
-wp.a11y.speak()' ); - ?>
-Plugin Developer Handbook.' ), 'https://developer.wordpress.org/plugins/taxonomy/working-with-split-terms-in-wp-4-2/' ); - ?>
- - -WP_Query', 'WP_Comment_Query', 'WP_User_Query' );
- ?>
' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "
\n"; -$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/'; - foreach ( $credits['groups'] as $group_slug => $group_data ) { if ( $group_data['name'] ) { if ( 'Translators' == $group_data['name'] ) { @@ -124,7 +120,7 @@ foreach ( $credits['groups'] as $group_slug => $group_data ) { $title = translate( $group_data['name'] ); } - echo '
' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?> @@ -619,7 +651,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) { } $type = esc_html( $type ); ?> -
+
search_term = wp_unslash( $search_term );
@@ -492,6 +492,20 @@ class WP_User_Search {
$this->do_paging();
}
+ /**
+ * PHP4 Constructor - Sets up the object properties.
+ *
+ * @since 2.1.0
+ *
+ * @param string $search_term Search terms string.
+ * @param int $page Optional. Page ID.
+ * @param string $role Role name.
+ * @return WP_User_Search
+ */
+ public function WP_User_Search( $search_term = '', $page = '', $role = '' ) {
+ self::__construct( $search_term, $page, $role );
+ }
+
/**
* {@internal Missing Short Description}}
*
@@ -572,9 +586,9 @@ class WP_User_Search {
function do_paging() {
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
$args = array();
- if( ! empty($this->search_term) )
+ if ( ! empty($this->search_term) )
$args['usersearch'] = urlencode($this->search_term);
- if( ! empty($this->role) )
+ if ( ! empty($this->role) )
$args['role'] = urlencode($this->role);
$this->paging_text = paginate_links( array(
@@ -732,6 +746,8 @@ function wp_dashboard_quick_press_output() {
* @deprecated 3.3.0
* @deprecated Use wp_editor()
* @see wp_editor()
+ *
+ * @staticvar int $num
*/
function wp_tiny_mce( $teeny = false, $settings = false ) {
_deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' );
diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php
index cd50e61..9898932 100644
--- a/wp-admin/includes/export.php
+++ b/wp-admin/includes/export.php
@@ -20,6 +20,9 @@ define( 'WXR_VERSION', '1.2' );
*
* @since 2.1.0
*
+ * @global wpdb $wpdb
+ * @global WP_Post $post
+ *
* @param array $args Filters defining what should be included in the export.
*/
function export_wp( $args = array() ) {
@@ -130,9 +133,9 @@ function export_wp( $args = array() ) {
* @return string
*/
function wxr_cdata( $str ) {
- if ( seems_utf8( $str ) == false )
+ if ( ! seems_utf8( $str ) ) {
$str = utf8_encode( $str );
-
+ }
// $str = ent2ncr(esc_html($str));
$str = '', ']]]]>', $str ) . ']]>';
@@ -244,6 +247,8 @@ function export_wp( $args = array() ) {
*
* @since 3.1.0
*
+ * @global wpdb $wpdb
+ *
* @param array $post_ids Array of post IDs to filter the query by. Optional.
*/
function wxr_authors_list( array $post_ids = null ) {
@@ -310,6 +315,12 @@ function export_wp( $args = array() ) {
}
}
+ /**
+ *
+ * @param bool $return_me
+ * @param string $meta_key
+ * @return bool
+ */
function wxr_filter_postmeta( $return_me, $meta_key ) {
if ( '_edit_lock' == $meta_key )
$return_me = true;
@@ -375,6 +386,9 @@ function export_wp( $args = array() ) {
?>
_screen );
$hidden = get_hidden_columns( $this->_screen );
@@ -107,6 +114,11 @@ class _WP_List_Table_Compat extends WP_List_Table {
return array( $columns, $hidden, $sortable );
}
+ /**
+ * @access public
+ *
+ * @return array
+ */
public function get_columns() {
return $this->_columns;
}
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 7581196..fc8ce0f 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -36,6 +36,8 @@ function media_upload_tabs() {
*
* @since 2.5.0
*
+ * @global wpdb $wpdb
+ *
* @param array $tabs
* @return array $tabs with gallery if post has image attachment
*/
@@ -61,12 +63,13 @@ function update_gallery_tab($tabs) {
return $tabs;
}
-add_filter('media_upload_tabs', 'update_gallery_tab');
/**
* {@internal Missing Short Description}}
*
* @since 2.5.0
+ *
+ * @global string $redir_tab
*/
function the_media_upload_tabs() {
global $redir_tab;
@@ -216,7 +219,6 @@ function image_add_caption( $html, $id, $caption, $title, $align, $url, $size, $
*/
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
-add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
/**
* Private preg_replace callback used in image_add_caption()
@@ -355,8 +357,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
), $post_data );
// This should never be set as it would then overwrite an existing attachment.
- if ( isset( $attachment['ID'] ) )
- unset( $attachment['ID'] );
+ unset( $attachment['ID'] );
// Save the data
$id = wp_insert_attachment($attachment, $file, $post_id);
@@ -419,8 +420,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
), $post_data );
// This should never be set as it would then overwrite an existing attachment.
- if ( isset( $attachment['ID'] ) )
- unset( $attachment['ID'] );
+ unset( $attachment['ID'] );
// Save the attachment metadata
$id = wp_insert_attachment($attachment, $file, $post_id);
@@ -435,6 +435,8 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
*
* @since 2.5.0
*
+ * @global int $body_id
+ *
* @param string|callable $content_func
*/
function wp_iframe($content_func /* ... */) {
@@ -529,6 +531,10 @@ document.body.className = document.body.className.replace('no-js', 'js');
*
* @since 2.5.0
*
+ * @global int $post_ID
+ *
+ * @staticvar int $instance
+ *
* @param string $editor_id
*/
function media_buttons($editor_id = 'content') {
@@ -546,10 +552,9 @@ function media_buttons($editor_id = 'content') {
$img = ' ';
$id_attribute = $instance === 1 ? ' id="insert-media-button"' : '';
- printf( '%s',
+ printf( '',
$id_attribute,
esc_attr( $editor_id ),
- esc_attr__( 'Add Media' ),
$img . __( 'Add Media' )
);
/**
@@ -569,7 +574,6 @@ function media_buttons($editor_id = 'content') {
echo $legacy_filter;
}
}
-add_action( 'media_buttons', 'media_buttons' );
/**
*
@@ -822,18 +826,20 @@ function wp_media_upload_handler() {
}
/**
- * Download an image from the specified URL and attach it to a post.
+ * Downloads an image from the specified URL and attaches it to a post.
*
* @since 2.6.0
+ * @since 4.2.0 Introduced the `$return` parameter.
*
- * @param string $file The URL of the image to download
- * @param int $post_id The post ID the media is to be associated with
- * @param string $desc Optional. Description of the image
- * @param string $return Optional. What to return: an image tag (default) or only the src.
- * @return string|WP_Error Populated HTML img tag on success
+ * @param string $file The URL of the image to download.
+ * @param int $post_id The post ID the media is to be associated with.
+ * @param string $desc Optional. Description of the image.
+ * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'.
+ * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.
*/
function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) {
if ( ! empty( $file ) ) {
+
// Set variables for storage, fix file filename for query strings.
preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
$file_array = array();
@@ -859,7 +865,7 @@ function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' )
$src = wp_get_attachment_url( $id );
}
- // Finally check to make sure the file has been saved, then return the HTML.
+ // Finally, check to make sure the file has been saved, then return the HTML.
if ( ! empty( $src ) ) {
if ( $return === 'src' ) {
return $src;
@@ -1050,6 +1056,14 @@ function image_link_input_fields($post, $url_type = '') {
";
}
+/**
+ * Output a textarea element for inputting an attachment caption.
+ *
+ * @since 3.4.0
+ *
+ * @param WP_Post $edit_post Attachment WP_Post object.
+ * @return string HTML markup for the textarea element.
+ */
function wp_caption_input_textarea($edit_post) {
// Post data is already escaped.
$name = "attachments[{$edit_post->ID}][post_excerpt]";
@@ -1123,8 +1137,6 @@ function image_attachment_fields_to_save( $post, $attachment ) {
return $post;
}
-add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
-
/**
* {@internal Missing Short Description}}
*
@@ -1150,8 +1162,6 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) {
return $html;
}
-add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3);
-
/**
* {@internal Missing Short Description}}
*
@@ -1280,6 +1290,8 @@ function get_attachment_fields_to_edit($post, $errors = null) {
*
* @since 2.5.0
*
+ * @global WP_Query $wp_the_query
+ *
* @param int $post_id Optional. Post ID.
* @param array $errors Errors for attachment, if any.
* @return string
@@ -1314,6 +1326,8 @@ function get_media_items( $post_id, $errors ) {
*
* @since 2.5.0
*
+ * @global string $redir_tab
+ *
* @param int $attachment_id Attachment ID for modification.
* @param string|array $args Optional. Override defaults.
* @return string HTML form for attachment.
@@ -1478,8 +1492,12 @@ function get_media_item( $attachment_id, $args = null ) {
}
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
+
+ $calling_post = get_post( $calling_post_id );
+ $calling_post_type_object = get_post_type_object( $calling_post->post_type );
+
$ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
- $thumbnail = "" . esc_html__( "Use as featured image" ) . "";
+ $thumbnail = "" . esc_html( $calling_post_type_object->labels->use_featured_image ) . "";
}
if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) {
@@ -1559,6 +1577,13 @@ function get_media_item( $attachment_id, $args = null ) {
return $item;
}
+/**
+ * @since 3.5.0
+ *
+ * @param int $attachment_id
+ * @param array $args
+ * @return array
+ */
function get_compat_media_markup( $attachment_id, $args = null ) {
$post = get_post( $attachment_id );
@@ -1715,7 +1740,8 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
*/
function media_upload_header() {
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
- echo '\n";
+
+ echo '';
if ( empty( $_GET['chromeless'] ) ) {
echo '';
the_media_upload_tabs();
@@ -1728,6 +1754,11 @@ function media_upload_header() {
*
* @since 2.5.0
*
+ * @global string $type
+ * @global string $tab
+ * @global bool $is_IE
+ * @global bool $is_opera
+ *
* @param array $errors
*/
function media_upload_form( $errors = null ) {
@@ -2127,6 +2158,10 @@ echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
*
* @since 2.5.0
*
+ * @global string $redir_tab
+ * @global string $type
+ * @global string $tab
+ *
* @param array $errors
*/
function media_upload_gallery_form($errors) {
@@ -2272,6 +2307,13 @@ jQuery(function($){
*
* @since 2.5.0
*
+ * @global wpdb $wpdb
+ * @global WP_Query $wp_query
+ * @global WP_Locale $wp_locale
+ * @global string $type
+ * @global string $tab
+ * @global array $post_mime_types
+ *
* @param array $errors
*/
function media_upload_library_form($errors) {
@@ -2556,6 +2598,8 @@ function wp_media_insert_url_form( $default_view = 'image' ) {
* Displays the multi-file uploader message.
*
* @since 2.6.0
+ *
+ * @global int $post_ID
*/
function media_upload_flash_bypass() {
$browser_uploader = admin_url( 'media-new.php?browser-uploader' );
@@ -2571,7 +2615,6 @@ function media_upload_flash_bypass() {
$data ) {
if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
- if (false == $separator_found) {
+ if ( ! $separator_found ) {
$separator_found = true;
} else {
unset($menu[$id]);
@@ -194,13 +194,23 @@ foreach ( $menu as $id => $data ) {
}
unset($id, $data);
+/**
+ *
+ * @param string $add
+ * @param string $class
+ * @return string
+ */
function add_cssclass($add, $class) {
$class = empty($class) ? $add : $class .= ' ' . $add;
return $class;
}
+/**
+ *
+ * @param array $menu
+ * @return array
+ */
function add_menu_classes($menu) {
-
$first = $lastorder = false;
$i = 0;
$mc = count($menu);
@@ -279,6 +289,15 @@ if ( apply_filters( 'custom_menu_order', false ) ) {
$menu_order = array_flip($menu_order);
$default_menu_order = array_flip($default_menu_order);
+ /**
+ *
+ * @global array $menu_order
+ * @global array $default_menu_order
+ *
+ * @param array $a
+ * @param array $b
+ * @return int
+ */
function sort_menu($a, $b) {
global $menu_order, $default_menu_order;
$a = $a[2];
diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
index 7005753..a7a895a 100644
--- a/wp-admin/includes/meta-boxes.php
+++ b/wp-admin/includes/meta-boxes.php
@@ -7,6 +7,8 @@
*
* @since 2.7.0
*
+ * @global string $action
+ *
* @param object $post
*/
function post_submit_meta_box($post, $args = array() ) {
@@ -204,7 +206,10 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
-
+
@@ -368,10 +373,13 @@ function post_format_meta_box( $post, $box ) {
$post_formats[0][] = $post_format;
?>
- />
-
-
- link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('link_name )); ?>') ) {return true;}return false;">
+ link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('link_name )); ?>') ) {return true;}return false;">
@@ -913,6 +923,8 @@ function link_target_meta_box($link) { ?>
*
* @since 1.0.1
*
+ * @global object $link
+ *
* @param string $class
* @param string $value
* @param mixed $deprecated Never used.
diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php
index 367611b..3b6f050 100644
--- a/wp-admin/includes/misc.php
+++ b/wp-admin/includes/misc.php
@@ -38,6 +38,8 @@ function got_mod_rewrite() {
*
* @since 3.7.0
*
+ * @global bool $is_nginx
+ *
* @return bool Whether the server supports URL rewriting.
*/
function got_url_rewrite() {
@@ -153,6 +155,8 @@ function insert_with_markers( $filename, $marker, $insertion ) {
* blank out old rules.
*
* @since 1.5.0
+ *
+ * @global WP_Rewrite $wp_rewrite
*/
function save_mod_rewrite_rules() {
if ( is_multisite() )
@@ -183,6 +187,8 @@ function save_mod_rewrite_rules() {
*
* @since 2.8.0
*
+ * @global WP_Rewrite $wp_rewrite
+ *
* @return bool True if web.config was updated successfully
*/
function iis7_save_url_rewrite_rules(){
@@ -244,10 +250,6 @@ function update_home_siteurl( $old_value, $value ) {
flush_rewrite_rules();
}
-add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
-add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
-add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
-
/**
* Shorten an URL, to be used as link text
*
@@ -308,6 +310,12 @@ function show_message($message) {
flush();
}
+/**
+ * @since 2.8.0
+ *
+ * @param string $content
+ * @return array
+ */
function wp_doc_link_parse( $content ) {
if ( !is_string( $content ) || empty( $content ) )
return array();
@@ -593,6 +601,8 @@ function saveDomDocument($doc, $filename) {
* Display the default admin color scheme picker (Used in user-edit.php)
*
* @since 3.0.0
+ *
+ * @global array $_wp_admin_css_colors
*/
function admin_color_scheme_picker( $user_id ) {
global $_wp_admin_css_colors;
@@ -646,6 +656,10 @@ function admin_color_scheme_picker( $user_id ) {
var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";\n";
}
-add_action( 'admin_head', 'wp_color_scheme_settings' );
+/**
+ * @since 3.3.0
+ */
function _ipad_meta() {
if ( wp_is_mobile() ) {
?>
@@ -676,7 +692,6 @@ function _ipad_meta() {
1 );
- if ( ! $post_id = absint( $received['post_id'] ) )
+ if ( ! $post_id = absint( $received['post_id'] ) ) {
return $response;
-
- if ( ! current_user_can( 'edit_post', $post_id ) || empty( $received['post_nonce'] ) )
- return $response;
-
- if ( 2 === wp_verify_nonce( $received['post_nonce'], 'update-post_' . $post_id ) ) {
- $response['wp-refresh-post-nonces'] = array(
- 'replace' => array(
- 'getpermalinknonce' => wp_create_nonce('getpermalink'),
- 'samplepermalinknonce' => wp_create_nonce('samplepermalink'),
- 'closedpostboxesnonce' => wp_create_nonce('closedpostboxes'),
- '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ),
- '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ),
- ),
- 'heartbeatNonce' => wp_create_nonce( 'heartbeat-nonce' ),
- );
}
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ return $response;
+ }
+
+ $response['wp-refresh-post-nonces'] = array(
+ 'replace' => array(
+ 'getpermalinknonce' => wp_create_nonce('getpermalink'),
+ 'samplepermalinknonce' => wp_create_nonce('samplepermalink'),
+ 'closedpostboxesnonce' => wp_create_nonce('closedpostboxes'),
+ '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ),
+ '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ),
+ ),
+ 'heartbeatNonce' => wp_create_nonce( 'heartbeat-nonce' ),
+ );
}
return $response;
}
-add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
/**
* Disable suspension of Heartbeat on the Add/Edit Post screens.
*
* @since 3.8.0
*
+ * @global string $pagenow
+ *
* @param array $settings An array of Heartbeat settings.
* @return array Filtered Heartbeat settings.
*/
@@ -799,7 +813,6 @@ function wp_heartbeat_set_suspension( $settings ) {
return $settings;
}
-add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
/**
* Autosave with heartbeat
@@ -824,8 +837,6 @@ function heartbeat_autosave( $response, $data ) {
return $response;
}
-// Run later as we have to set DOING_AUTOSAVE for back-compat
-add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
/**
* Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
@@ -833,6 +844,9 @@ add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
* when the user navigates to it with the browser's Back button. See #28037
*
* @since 4.0
+ *
+ * @global bool $is_safari
+ * @global bool $is_chrome
*/
function post_form_autocomplete_off() {
global $is_safari, $is_chrome;
@@ -841,7 +855,6 @@ function post_form_autocomplete_off() {
echo ' autocomplete="off"';
}
}
-add_action( 'post_edit_form_tag', 'post_form_autocomplete_off' );
/**
* Remove single-use URL parameters and create canonical link based on new URL.
@@ -886,4 +899,3 @@ function wp_admin_canonical_url() {
exists() )
return false;
+
+ // Global super-administrators are protected, and cannot be deleted.
+ $_super_admins = get_super_admins();
+ if ( in_array( $user->user_login, $_super_admins, true ) ) {
+ return false;
+ }
+
/**
* Fires before a user is deleted from the network.
*
@@ -253,6 +263,7 @@ function update_option_new_admin_email( $old_value, $value ) {
);
update_option( 'adminhash', $new_admin_email );
+ /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
$email_text = __( 'Howdy ###USERNAME###,
You recently requested to have the administration email address on
@@ -287,6 +298,7 @@ All at ###SITENAME###
*/
$content = apply_filters( 'new_admin_email_content', $email_text, $new_admin_email );
+ $current_user = wp_get_current_user();
$content = str_replace( '###USERNAME###', $current_user->user_login, $content );
$content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content );
$content = str_replace( '###EMAIL###', $value, $content );
@@ -295,8 +307,6 @@ All at ###SITENAME###
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
}
-add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
-add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
/**
* Sends an email when an email address change is requested.
@@ -334,6 +344,7 @@ function send_confirmation_on_profile_email() {
);
update_option( $current_user->ID . '_new_email', $new_user_email );
+ /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
$email_text = __( 'Howdy ###USERNAME###,
You recently requested to have the email address on your account changed.
@@ -377,7 +388,6 @@ All at ###SITENAME###
$_POST['email'] = $current_user->user_email;
}
}
-add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
/**
* Adds an admin notice alerting the user to check for confirmation email
@@ -389,7 +399,6 @@ function new_user_email_admin_notice() {
if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )
echo "" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . " ";
}
-add_action( 'admin_notices', 'new_user_email_admin_notice' );
/**
* Check whether a blog has used its allotted upload space.
@@ -452,9 +461,9 @@ function display_space_usage() {
* @return int Max size in bytes
*/
function fix_import_form_size( $size ) {
- if ( upload_is_user_over_quota( false ) == true )
+ if ( upload_is_user_over_quota( false ) ) {
return 0;
-
+ }
$available = get_upload_space_available();
return min( $size, $available );
}
@@ -484,7 +493,6 @@ function upload_space_setting( $id ) {
" . sprintf( __( 'Thank you for Updating! Please visit the Upgrade Network page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "
$type", $comment_post_link." ".$comment_link ); ?>
@@ -770,6 +802,9 @@ function wp_dashboard_recent_comments( $total_items = 5 ) { $comments_query['status'] = 'approve'; while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) { + if ( ! is_array( $possible ) ) { + break; + } foreach ( $possible as $comment ) { if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) ) continue; @@ -845,7 +880,8 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar $check_urls = array( $widgets[$widget_id]['url'] ); } - $cache_key = 'dash_' . md5( $widget_id ); + $locale = get_locale(); + $cache_key = 'dash_' . md5( $widget_id . '_' . $locale ); if ( false !== ( $output = get_transient( $cache_key ) ) ) { echo $output; return true; @@ -875,6 +911,8 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar * * @since 2.5.0 * + * @global array $wp_dashboard_control_callbacks + * * @param int $widget_control_id Registered Widget ID. */ function wp_dashboard_trigger_widget_control( $widget_control_id = false ) { @@ -1174,7 +1212,6 @@ function wp_dashboard_quota() {/> -
+
--
+
+
>
type_label ); ?>
@@ -133,11 +135,11 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
?>">
-
-
+
+
- type ) : ?>
+ type ) : ?>
- type && $original_title !== false ) : ?>
+ type && $original_title !== false ) : ?>
';
- if( empty($menu_items) )
+ if ( empty($menu_items) )
return $result . ' ';
- elseif ( isset( $menu_items[$menu_item_db_id] ) )
- unset( $menu_items[$menu_item_db_id] );
+ } else {
+ unset( $menu_items[ $menu_item_db_id ] );
+ }
}
}
diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php
index b8cf32f..ab776e8 100644
--- a/wp-admin/includes/plugin-install.php
+++ b/wp-admin/includes/plugin-install.php
@@ -130,6 +130,9 @@ function install_popular_tags( $args = array() ) {
return $tags;
}
+/**
+ * @since 2.7.0
+ */
function install_dashboard() {
?>
cap->edit_others_posts ) ) {
+ if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
if ( ! empty( $post_data['sticky'] ) )
stick_post( $post_ID );
else
@@ -401,6 +403,8 @@ function edit_post( $post_data = null ) {
*
* @since 2.7.0
*
+ * @global wpdb $wpdb
+ *
* @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal.
* @return array
*/
@@ -606,8 +610,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
$post->post_status = 'draft';
$post->to_ping = '';
$post->pinged = '';
- $post->comment_status = get_option( 'default_comment_status' );
- $post->ping_status = get_option( 'default_ping_status' );
+ $post->comment_status = get_default_comment_status( $post_type );
+ $post->ping_status = get_default_comment_status( $post_type, 'pingback' );
$post->post_pingback = get_option( 'default_pingback_flag' );
$post->post_category = get_option( 'default_category' );
$post->page_template = 'default';
@@ -654,6 +658,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
*
* @since 2.0.0
*
+ * @global wpdb $wpdb
+ *
* @param string $title Post title
* @param string $content Optional post content
* @param string $date Optional post date
@@ -695,6 +701,8 @@ function post_exists($title, $content = '', $date = '') {
*
* @since 2.1.0
*
+ * @global WP_User $current_user
+ *
* @return int|WP_Error
*/
function wp_write_post() {
@@ -834,6 +842,8 @@ function delete_meta( $mid ) {
*
* @since 1.2.0
*
+ * @global wpdb $wpdb
+ *
* @return mixed
*/
function get_meta_keys() {
@@ -865,6 +875,8 @@ function get_post_meta_by_id( $mid ) {
*
* @since 1.2.0
*
+ * @global wpdb $wpdb
+ *
* @param int $postid
* @return mixed
*/
@@ -1055,6 +1067,8 @@ function wp_edit_posts_query( $q = false ) {
*
* @since 2.5.0
*
+ * @global wpdb $wpdb
+ *
* @param string $type
* @return mixed
*/
@@ -1304,7 +1318,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
}
if ( isset( $view_post ) ) {
- if( 'draft' == $post->post_status ) {
+ if ( 'draft' == $post->post_status ) {
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
/** This filter is documented in wp-admin/includes/meta-boxes.php */
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
@@ -1338,6 +1352,9 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
*
* @since 2.9.0
*
+ * @global int $content_width
+ * @global array $_wp_additional_image_sizes
+ *
* @param int $thumbnail_id ID of the attachment used for thumbnail
* @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
* @return string html
@@ -1345,11 +1362,16 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {
global $content_width, $_wp_additional_image_sizes;
- $post = get_post( $post );
+ $post = get_post( $post );
+ $post_type_object = get_post_type_object( $post->post_type );
+ $set_thumbnail_link = '
get_help_tabs() ) : ?>
-
+
show_screen_options() ) : ?>
-
+
postmeta
- GROUP BY meta_key
+ WHERE meta_key NOT BETWEEN '_' AND '_z'
HAVING meta_key NOT LIKE %s
ORDER BY meta_key
LIMIT %d";
@@ -737,6 +743,9 @@ function meta_form( $post = null ) {
*
* @since 0.71
*
+ * @global WP_Locale $wp_locale
+ * @global object $comment
+ *
* @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date.
* @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment.
* @param int $tab_index The tabindex attribute to add. Default 0.
@@ -772,23 +781,24 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$cur_hh = gmdate( 'H', $time_adj );
$cur_mn = gmdate( 'i', $time_adj );
- $month = '';
- $day = '';
- $year = '';
- $hour = '';
- $minute = '';
+ $day = '';
+ $year = '';
+ $hour = '';
+ $minute = '';
echo '';
/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
- printf( __( '%1$s %2$s, %3$s @ %4$s : %5$s' ), $month, $day, $year, $hour, $minute );
+ printf( __( '%1$s %2$s, %3$s @ %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
echo ' ';
@@ -839,6 +849,8 @@ function page_template_dropdown( $default = '' ) {
*
* @since 1.5.0
*
+ * @global wpdb $wpdb
+ *
* @param int $default Optional. The default page ID to be pre-selected. Default 0.
* @param int $parent Optional. The parent page ID. Default 0.
* @param int $level Optional. Page depth level. Default 0.
@@ -934,6 +946,8 @@ function wp_import_upload_form( $action ) {
*
* @since 2.5.0
*
+ * @global array $wp_meta_boxes
+ *
* @param string $id String for use in the 'id' attribute of tags.
* @param string $title Title of the meta box.
* @param callback $callback Function that fills the box with the desired content.
@@ -1022,10 +1036,12 @@ function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan
*
* @since 2.5.0
*
+ * @global array $wp_meta_boxes
+ *
* @staticvar bool $already_sorted
- * @param string|WP_Screen $screen Screen identifier
- * @param string $context box context
- * @param mixed $object gets passed to the box callback function as first parameter
+ * @param string|WP_Screen $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( $screen, $context, $object ) {
@@ -1090,9 +1106,11 @@ function do_meta_boxes( $screen, $context, $object ) {
*
* @since 2.6.0
*
- * @param string $id String for use in the 'id' attribute of tags.
- * @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').
+ * @global array $wp_meta_boxes
+ *
+ * @param string $id String for use in the 'id' attribute of tags.
+ * @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, $screen, $context) {
global $wp_meta_boxes;
@@ -1126,9 +1144,9 @@ function remove_meta_box($id, $screen, $context) {
*
* @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
*
- * @param string|object $screen The screen identifier.
- * @param string $context The meta box context.
- * @param mixed $object gets passed to the section callback function as first parameter.
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
* @return int number of meta boxes as accordion sections.
*/
function do_accordion_sections( $screen, $context, $object ) {
@@ -1204,10 +1222,10 @@ function do_accordion_sections( $screen, $context, $object ) {
*
* @global $wp_settings_sections Storage array of all settings sections added to admin pages
*
- * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
- * @param string $title Formatted title of the section. Shown as the heading for the section.
+ * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
+ * @param string $title Formatted title of the section. Shown as the heading for the section.
* @param string $callback Function that echos out any content at the top of the section (between heading and fields).
- * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
+ * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page();
*/
function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections;
@@ -1465,9 +1483,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
*
* @since 3.0.0
*
- * @param string $setting Optional slug title of a specific setting who's errors you want.
- * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
- * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
+ * @param string $setting Optional slug title of a specific setting who's errors you want.
+ * @param bool $sanitize Whether to re-sanitize the setting value before returning errors.
+ * @param bool $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
*/
function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
@@ -1576,6 +1594,10 @@ function _admin_search_query() {
*
* @since 2.7.0
*
+ * @global string $hook_suffix
+ * @global string $admin_body_class
+ * @global WP_Locale $wp_locale
+ *
* @param string $title Optional. Title of the Iframe page. Default empty.
* @param bool $deprecated Not used.
*/
@@ -1637,7 +1659,11 @@ if ( is_rtl() )
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
?>
- class="wp-admin wp-core-ui no-js iframe ">
+ class="wp-admin wp-core-ui no-js iframe ">
wp_content_dir() returned unslashed pre-2.8
+
+ /**
+ * Import $wp_version, $required_php_version, and $required_mysql_version from the new version
+ * $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
+ *
+ * @global string $wp_version
+ * @global string $required_php_version
+ * @global string $required_mysql_version
+ */
global $wp_version, $required_php_version, $required_mysql_version;
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
@@ -1101,8 +1121,10 @@ function update_core($from, $to) {
* @since 3.7.0 Updated not to use a regular expression for the skip list
* @see copy_dir()
*
- * @param string $from source directory
- * @param string $to destination directory
+ * @global WP_Filesystem_Base $wp_filesystem
+ *
+ * @param string $from source directory
+ * @param string $to destination directory
* @param array $skip_list a list of files/folders to skip copying
* @return mixed WP_Error on failure, True on success.
*/
@@ -1156,6 +1178,11 @@ function _copy_dir($from, $to, $skip_list = array() ) {
*
* @since 3.3.0
*
+ * @global string $wp_version
+ * @global string $pagenow
+ * @global string $action
+ *
+ * @param string $new_version
*/
function _redirect_to_about_wordpress( $new_version ) {
global $wp_version, $pagenow, $action;
@@ -1190,12 +1217,14 @@ window.location = 'about.php?updated';
include(ABSPATH . 'wp-admin/admin-footer.php');
exit();
}
-add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
/**
* Cleans up Genericons example files.
*
* @since 4.2.2
+ *
+ * @global array $wp_theme_directories
+ * @global WP_Filesystem_Base $wp_filesystem
*/
function _upgrade_422_remove_genericons() {
global $wp_theme_directories, $wp_filesystem;
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index ba03453..9bbb0c0 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -9,7 +9,7 @@
/**
* Selects the first update version from the update_core option.
*
- * @return bool|object The response from the API on success, false on failure.
+ * @return object|array|false The response from the API on success, false on failure.
*/
function get_preferred_from_update_core() {
$updates = get_core_updates();
@@ -24,8 +24,8 @@ function get_preferred_from_update_core() {
* Get available core updates.
*
* @param array $options Set $options['dismissed'] to true to show dismissed upgrades too,
- * set $options['available'] to false to skip not-dismissed updates.
- * @return bool|array Array of the update objects on success, false on failure.
+ * set $options['available'] to false to skip not-dismissed updates.
+ * @return array|false Array of the update objects on success, false on failure.
*/
function get_core_updates( $options = array() ) {
$options = array_merge( array( 'available' => true, 'dismissed' => false ), $options );
@@ -67,7 +67,7 @@ function get_core_updates( $options = array() ) {
*
* @since 3.7.0
*
- * @return bool|array False on failure, otherwise the core update offering.
+ * @return array|false False on failure, otherwise the core update offering.
*/
function find_core_auto_update() {
$updates = get_site_transient( 'update_core' );
@@ -128,12 +128,23 @@ function get_core_checksums( $version, $locale ) {
return $body['checksums'];
}
+/**
+ *
+ * @param object $update
+ * @return bool
+ */
function dismiss_core_update( $update ) {
$dismissed = get_site_option( 'dismissed_update_core' );
$dismissed[ $update->current . '|' . $update->locale ] = true;
return update_site_option( 'dismissed_update_core', $dismissed );
}
+/**
+ *
+ * @param string $version
+ * @param string $locale
+ * @return bool
+ */
function undismiss_core_update( $version, $locale ) {
$dismissed = get_site_option( 'dismissed_update_core' );
$key = $version . '|' . $locale;
@@ -145,6 +156,12 @@ function undismiss_core_update( $version, $locale ) {
return update_site_option( 'dismissed_update_core', $dismissed );
}
+/**
+ *
+ * @param string $version
+ * @param string $locale
+ * @return object|false
+ */
function find_core_update( $version, $locale ) {
$from_api = get_site_transient( 'update_core' );
@@ -159,6 +176,11 @@ function find_core_update( $version, $locale ) {
return false;
}
+/**
+ *
+ * @param string $msg
+ * @return string
+ */
function core_update_footer( $msg = '' ) {
if ( !current_user_can('update_core') )
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
@@ -188,8 +210,12 @@ function core_update_footer( $msg = '' ) {
return sprintf( __( 'Version %s' ), get_bloginfo( 'version', 'display' ) );
}
}
-add_filter( 'update_footer', 'core_update_footer' );
+/**
+ *
+ * @global string $pagenow
+ * @return false|void
+ */
function update_nag() {
if ( is_multisite() && !current_user_can('update_core') )
return false;
@@ -211,8 +237,6 @@ function update_nag() {
}
echo "$msg ";
}
-add_action( 'admin_notices', 'update_nag', 3 );
-add_action( 'network_admin_notices', 'update_nag', 3 );
// Called directly from dashboard
function update_right_now_message() {
@@ -235,6 +259,11 @@ function update_right_now_message() {
echo " ';
}
+/**
+ *
+ * @global int $upgrading
+ * @return false|void
+ */
function maintenance_nag() {
include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
global $upgrading;
@@ -431,5 +490,3 @@ function maintenance_nag() {
echo "$msg ";
}
-add_action( 'admin_notices', 'maintenance_nag' );
-add_action( 'network_admin_notices', 'maintenance_nag' );
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index cb2188b..86d8cf9 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -118,6 +118,10 @@ if ( !function_exists('wp_install_defaults') ) :
*
* @since 2.1.0
*
+ * @global wpdb $wpdb
+ * @global WP_Rewrite $wp_rewrite
+ * @global string $table_prefix
+ *
* @param int $user_id User ID.
*/
function wp_install_defaults( $user_id ) {
@@ -152,31 +156,31 @@ function wp_install_defaults( $user_id ) {
$first_post = get_site_option( 'first_post' );
if ( empty($first_post) )
- $first_post = __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' );
+ $first_post = __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start writing!' );
$first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
$first_post = str_replace( "SITE_NAME", get_current_site()->site_name, $first_post );
} else {
- $first_post = __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!');
+ $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
}
$wpdb->insert( $wpdb->posts, array(
- 'post_author' => $user_id,
- 'post_date' => $now,
- 'post_date_gmt' => $now_gmt,
- 'post_content' => $first_post,
- 'post_excerpt' => '',
- 'post_title' => __('Hello world!'),
- /* translators: Default post slug */
- 'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ),
- 'post_modified' => $now,
- 'post_modified_gmt' => $now_gmt,
- 'guid' => $first_post_guid,
- 'comment_count' => 1,
- 'to_ping' => '',
- 'pinged' => '',
- 'post_content_filtered' => ''
- ));
+ 'post_author' => $user_id,
+ 'post_date' => $now,
+ 'post_date_gmt' => $now_gmt,
+ 'post_content' => $first_post,
+ 'post_excerpt' => '',
+ 'post_title' => __('Hello world!'),
+ /* translators: Default post slug */
+ 'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ),
+ 'post_modified' => $now,
+ 'post_modified_gmt' => $now_gmt,
+ 'guid' => $first_post_guid,
+ 'comment_count' => 1,
+ 'to_ping' => '',
+ 'pinged' => '',
+ 'post_content_filtered' => ''
+ ));
$wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $cat_tt_id, 'object_id' => 1) );
// Default comment
@@ -190,19 +194,19 @@ To delete a comment, just log in and view the post's comments. There you wi
$first_comment = get_site_option( 'first_comment', $first_comment );
}
$wpdb->insert( $wpdb->comments, array(
- 'comment_post_ID' => 1,
- 'comment_author' => $first_comment_author,
- 'comment_author_email' => '',
- 'comment_author_url' => $first_comment_url,
- 'comment_date' => $now,
- 'comment_date_gmt' => $now_gmt,
- 'comment_content' => $first_comment
- ));
+ 'comment_post_ID' => 1,
+ 'comment_author' => $first_comment_author,
+ 'comment_author_email' => '',
+ 'comment_author_url' => $first_comment_url,
+ 'comment_date' => $now,
+ 'comment_date_gmt' => $now_gmt,
+ 'comment_content' => $first_comment
+ ));
// First Page
$first_page = sprintf( __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
-
+
...or something like this:
@@ -213,22 +217,22 @@ As a new WordPress user, you should go to your dashboard to d
$first_page = get_site_option( 'first_page', $first_page );
$first_post_guid = get_option('home') . '/?page_id=2';
$wpdb->insert( $wpdb->posts, array(
- 'post_author' => $user_id,
- 'post_date' => $now,
- 'post_date_gmt' => $now_gmt,
- 'post_content' => $first_page,
- 'post_excerpt' => '',
- 'post_title' => __( 'Sample Page' ),
- /* translators: Default page slug */
- 'post_name' => __( 'sample-page' ),
- 'post_modified' => $now,
- 'post_modified_gmt' => $now_gmt,
- 'guid' => $first_post_guid,
- 'post_type' => 'page',
- 'to_ping' => '',
- 'pinged' => '',
- 'post_content_filtered' => ''
- ));
+ 'post_author' => $user_id,
+ 'post_date' => $now,
+ 'post_date_gmt' => $now_gmt,
+ 'post_content' => $first_page,
+ 'post_excerpt' => '',
+ 'post_title' => __( 'Sample Page' ),
+ /* translators: Default page slug */
+ 'post_name' => __( 'sample-page' ),
+ 'post_modified' => $now,
+ 'post_modified_gmt' => $now_gmt,
+ 'guid' => $first_post_guid,
+ 'post_type' => 'page',
+ 'to_ping' => '',
+ 'pinged' => '',
+ 'post_content_filtered' => ''
+ ));
$wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );
// Set up default widgets for default theme.
@@ -385,7 +389,9 @@ if ( !function_exists('wp_upgrade') ) :
*
* @since 2.1.0
*
- * @return null If no update is necessary or site isn't completely installed, null.
+ * @global int $wp_current_db_version
+ * @global int $wp_db_version
+ * @global wpdb $wpdb
*/
function wp_upgrade() {
global $wp_current_db_version, $wp_db_version, $wpdb;
@@ -435,7 +441,8 @@ endif;
*
* @since 1.0.1
*
- * @return null If no update is necessary, null.
+ * @global int $wp_current_db_version
+ * @global int $wp_db_version
*/
function upgrade_all() {
global $wp_current_db_version, $wp_db_version;
@@ -524,11 +531,8 @@ function upgrade_all() {
if ( $wp_current_db_version < 29630 )
upgrade_400();
- if ( $wp_current_db_version < 31534 )
- upgrade_422();
-
- if ( $wp_current_db_version < 31536 )
- upgrade_423();
+ if ( $wp_current_db_version < 33055 )
+ upgrade_430();
maybe_disable_link_manager();
@@ -542,6 +546,8 @@ function upgrade_all() {
* Execute changes made in WordPress 1.0.
*
* @since 1.0.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_100() {
global $wpdb;
@@ -598,6 +604,8 @@ function upgrade_100() {
* Execute changes made in WordPress 1.0.1.
*
* @since 1.0.1
+ *
+ * @global wpdb $wpdb
*/
function upgrade_101() {
global $wpdb;
@@ -616,6 +624,8 @@ function upgrade_101() {
* Execute changes made in WordPress 1.2.
*
* @since 1.2.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_110() {
global $wpdb;
@@ -676,6 +686,8 @@ function upgrade_110() {
* Execute changes made in WordPress 1.5.
*
* @since 1.5.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_130() {
global $wpdb;
@@ -760,6 +772,9 @@ function upgrade_130() {
* Execute changes made in WordPress 2.0.
*
* @since 2.0.0
+ *
+ * @global wpdb $wpdb
+ * @global int $wp_current_db_version
*/
function upgrade_160() {
global $wpdb, $wp_current_db_version;
@@ -843,6 +858,9 @@ function upgrade_160() {
* Execute changes made in WordPress 2.1.
*
* @since 2.1.0
+ *
+ * @global wpdb $wpdb
+ * @global int $wp_current_db_version
*/
function upgrade_210() {
global $wpdb, $wp_current_db_version;
@@ -887,6 +905,9 @@ function upgrade_210() {
* Execute changes made in WordPress 2.3.
*
* @since 2.3.0
+ *
+ * @global wpdb $wpdb
+ * @global int $wp_current_db_version
*/
function upgrade_230() {
global $wp_current_db_version, $wpdb;
@@ -1063,6 +1084,8 @@ function upgrade_230() {
* Remove old options from the database.
*
* @since 2.3.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_230_options_table() {
global $wpdb;
@@ -1077,6 +1100,8 @@ function upgrade_230_options_table() {
* Remove old categories, link2cat, and post2cat database tables.
*
* @since 2.3.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_230_old_tables() {
global $wpdb;
@@ -1089,6 +1114,8 @@ function upgrade_230_old_tables() {
* Upgrade old slugs made in version 2.2.
*
* @since 2.2.0
+ *
+ * @global wpdb $wpdb
*/
function upgrade_old_slugs() {
// Upgrade people who were using the Redirect Old Slugs plugin.
@@ -1100,6 +1127,8 @@ function upgrade_old_slugs() {
* Execute changes made in WordPress 2.5.0.
*
* @since 2.5.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_250() {
global $wp_current_db_version;
@@ -1114,6 +1143,8 @@ function upgrade_250() {
* Execute changes made in WordPress 2.5.2.
*
* @since 2.5.2
+ *
+ * @global wpdb $wpdb
*/
function upgrade_252() {
global $wpdb;
@@ -1125,6 +1156,8 @@ function upgrade_252() {
* Execute changes made in WordPress 2.6.
*
* @since 2.6.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_260() {
global $wp_current_db_version;
@@ -1137,6 +1170,9 @@ function upgrade_260() {
* Execute changes made in WordPress 2.7.
*
* @since 2.7.0
+ *
+ * @global wpdb $wpdb
+ * @global int $wp_current_db_version
*/
function upgrade_270() {
global $wpdb, $wp_current_db_version;
@@ -1153,6 +1189,9 @@ function upgrade_270() {
* Execute changes made in WordPress 2.8.
*
* @since 2.8.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function upgrade_280() {
global $wp_current_db_version, $wpdb;
@@ -1180,6 +1219,8 @@ function upgrade_280() {
* Execute changes made in WordPress 2.9.
*
* @since 2.9.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_290() {
global $wp_current_db_version;
@@ -1197,6 +1238,9 @@ function upgrade_290() {
* Execute changes made in WordPress 3.0.
*
* @since 3.0.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function upgrade_300() {
global $wp_current_db_version, $wpdb;
@@ -1208,7 +1252,7 @@ function upgrade_300() {
add_site_option( 'siteurl', '' );
// 3.0 screen options key name changes.
- if ( is_main_site() && !defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) {
+ if ( wp_should_upgrade_global_tables() ) {
$sql = "DELETE FROM $wpdb->usermeta
WHERE meta_key LIKE %s
OR meta_key LIKE %s
@@ -1239,11 +1283,16 @@ function upgrade_300() {
* Execute changes made in WordPress 3.3.
*
* @since 3.3.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
+ * @global array $wp_registered_widgets
+ * @global array $sidebars_widgets
*/
function upgrade_330() {
global $wp_current_db_version, $wpdb, $wp_registered_widgets, $sidebars_widgets;
- if ( $wp_current_db_version < 19061 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( $wp_current_db_version < 19061 && wp_should_upgrade_global_tables() ) {
$wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key IN ('show_admin_bar_admin', 'plugins_last_view')" );
}
@@ -1308,6 +1357,9 @@ function upgrade_330() {
* Execute changes made in WordPress 3.4.
*
* @since 3.4.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function upgrade_340() {
global $wp_current_db_version, $wpdb;
@@ -1324,7 +1376,7 @@ function upgrade_340() {
$wpdb->show_errors();
}
- if ( $wp_current_db_version < 20022 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( $wp_current_db_version < 20022 && wp_should_upgrade_global_tables() ) {
$wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key = 'themes_last_view'" );
}
@@ -1341,6 +1393,9 @@ function upgrade_340() {
* Execute changes made in WordPress 3.5.
*
* @since 3.5.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function upgrade_350() {
global $wp_current_db_version, $wpdb;
@@ -1348,7 +1403,7 @@ function upgrade_350() {
if ( $wp_current_db_version < 22006 && $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) )
update_option( 'link_manager_enabled', 1 ); // Previously set to 0 by populate_options()
- if ( $wp_current_db_version < 21811 && is_main_site() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( $wp_current_db_version < 21811 && wp_should_upgrade_global_tables() ) {
$meta_keys = array();
foreach ( array_merge( get_post_types(), get_taxonomies() ) as $name ) {
if ( false !== strpos( $name, '-' ) )
@@ -1368,6 +1423,8 @@ function upgrade_350() {
* Execute changes made in WordPress 3.7.
*
* @since 3.7.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_370() {
global $wp_current_db_version;
@@ -1380,6 +1437,8 @@ function upgrade_370() {
*
* @since 3.7.2
* @since 3.8.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_372() {
global $wp_current_db_version;
@@ -1391,6 +1450,8 @@ function upgrade_372() {
* Execute changes made in WordPress 3.8.0.
*
* @since 3.8.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_380() {
global $wp_current_db_version;
@@ -1403,6 +1464,8 @@ function upgrade_380() {
* Execute changes made in WordPress 4.0.0.
*
* @since 4.0.0
+ *
+ * @global int $wp_current_db_version
*/
function upgrade_400() {
global $wp_current_db_version;
@@ -1421,80 +1484,39 @@ function upgrade_400() {
* Execute changes made in WordPress 4.2.0.
*
* @since 4.2.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
-function upgrade_420() {
-}
+function upgrade_420() {}
/**
- * Execute changes made in WordPress 4.2.1.
+ * Executes changes made in WordPress 4.3.0.
*
- * @since 4.2.1
- */
-function upgrade_421() {
-}
-
-/**
- * Execute changes made in WordPress 4.2.2.
+ * @since 4.3.0
*
- * @since 4.2.2
+ * @global int $wp_current_db_version Current version.
+ * @global wpdb $wpdb WordPress database abstraction object.
*/
-function upgrade_422() {
+function upgrade_430() {
global $wp_current_db_version, $wpdb;
- if ( $wp_current_db_version < 31534 ) {
- $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
-
- if ( is_wp_error( $content_length ) ) {
- return;
- }
-
- if ( false === $content_length ) {
- $content_length = array(
- 'type' => 'byte',
- 'length' => 65535,
- );
- } elseif ( ! is_array( $content_length ) ) {
- $length = (int) $content_length > 0 ? (int) $content_length : 65535;
- $content_length = array(
- 'type' => 'byte',
- 'length' => $length
- );
- }
-
- if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {
- // Sites with malformed DB schemas are on their own.
- return;
- }
-
- $allowed_length = intval( $content_length['length'] ) - 10;
-
- $comments = $wpdb->get_results(
- "SELECT `comment_ID` FROM `{$wpdb->comments}`
- WHERE `comment_date_gmt` > '2015-04-26'
- AND LENGTH( `comment_content` ) >= {$allowed_length}
- AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
- );
-
- foreach ( $comments as $comment ) {
- wp_delete_comment( $comment->comment_ID, true );
- }
+ if ( $wp_current_db_version < 32364 ) {
+ upgrade_430_fix_comments();
}
-}
-/**
- * Execute changes made in WordPress 4.2.0.
- *
- * @since 4.2.3
- */
-function upgrade_423() {
- global $wp_current_db_version, $wpdb;
+ // Shared terms are split in a separate process.
+ if ( $wp_current_db_version < 32814 ) {
+ update_option( 'finished_splitting_shared_terms', 0 );
+ wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_split_shared_term_batch' );
+ }
- if ( $wp_current_db_version < 31536 && $wpdb->charset === 'utf8mb4' ) {
+ if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
if ( is_multisite() ) {
$tables = $wpdb->tables( 'blog' );
} else {
$tables = $wpdb->tables( 'all' );
- if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( ! wp_should_upgrade_global_tables() ) {
$global_tables = $wpdb->tables( 'global' );
$tables = array_diff_assoc( $tables, $global_tables );
}
@@ -1506,10 +1528,62 @@ function upgrade_423() {
}
}
+/**
+ * Executes comments changes made in WordPress 4.3.0.
+ *
+ * @since 4.3.0
+ *
+ * @global int $wp_current_db_version Current version.
+ * @global wpdb $wpdb WordPress database abstraction object.
+ */
+function upgrade_430_fix_comments() {
+ global $wp_current_db_version, $wpdb;
+
+ $content_length = $wpdb->get_col_length( $wpdb->comments, 'comment_content' );
+
+ if ( is_wp_error( $content_length ) ) {
+ return;
+ }
+
+ if ( false === $content_length ) {
+ $content_length = array(
+ 'type' => 'byte',
+ 'length' => 65535,
+ );
+ } elseif ( ! is_array( $content_length ) ) {
+ $length = (int) $content_length > 0 ? (int) $content_length : 65535;
+ $content_length = array(
+ 'type' => 'byte',
+ 'length' => $length
+ );
+ }
+
+ if ( 'byte' !== $content_length['type'] || 0 === $content_length['length'] ) {
+ // Sites with malformed DB schemas are on their own.
+ return;
+ }
+
+ $allowed_length = intval( $content_length['length'] ) - 10;
+
+ $comments = $wpdb->get_results(
+ "SELECT `comment_ID` FROM `{$wpdb->comments}`
+ WHERE `comment_date_gmt` > '2015-04-26'
+ AND LENGTH( `comment_content` ) >= {$allowed_length}
+ AND ( `comment_content` LIKE '%<%' OR `comment_content` LIKE '%>%' )"
+ );
+
+ foreach ( $comments as $comment ) {
+ wp_delete_comment( $comment->comment_ID, true );
+ }
+}
+
/**
* Executes network-level upgrade routines.
*
* @since 3.0.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function upgrade_network() {
global $wp_current_db_version, $wpdb;
@@ -1605,7 +1679,7 @@ function upgrade_network() {
// 4.2
if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
- if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( wp_should_upgrade_global_tables() ) {
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
$wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
$wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
@@ -1613,15 +1687,20 @@ function upgrade_network() {
$tables = $wpdb->tables( 'global' );
+ // sitecategories may not exist.
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
+ unset( $tables['sitecategories'] );
+ }
+
foreach ( $tables as $table ) {
maybe_convert_table_to_utf8mb4( $table );
}
}
}
- // 4.2.2
- if ( $wp_current_db_version < 31535 && 'utf8mb4' === $wpdb->charset ) {
- if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ // 4.3
+ if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
+ if ( wp_should_upgrade_global_tables() ) {
$upgrade = false;
$indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
foreach( $indexes as $index ) {
@@ -1634,14 +1713,14 @@ function upgrade_network() {
if ( $upgrade ) {
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
}
- }
- }
- // 4.2.3
- if ( $wp_current_db_version < 31536 && $wpdb->charset === 'utf8mb4' ) {
- if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
$tables = $wpdb->tables( 'global' );
+ // sitecategories may not exist.
+ if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
+ unset( $tables['sitecategories'] );
+ }
+
foreach ( $tables as $table ) {
maybe_convert_table_to_utf8mb4( $table );
}
@@ -1662,6 +1741,8 @@ function upgrade_network() {
*
* @since 1.0.0
*
+ * @global wpdb $wpdb
+ *
* @param string $table_name Database table name to create.
* @param string $create_ddl SQL statement to create table.
* @return bool If table already exists or was created by function.
@@ -1690,9 +1771,11 @@ function maybe_create_table($table_name, $create_ddl) {
*
* @since 1.0.1
*
+ * @global wpdb $wpdb
+ *
* @param string $table Database table name.
* @param string $index Index name to drop.
- * @return bool True, when finished.
+ * @return true True, when finished.
*/
function drop_index($table, $index) {
global $wpdb;
@@ -1711,9 +1794,11 @@ function drop_index($table, $index) {
*
* @since 1.0.1
*
+ * @global wpdb $wpdb
+ *
* @param string $table Database table name.
* @param string $index Database table index column.
- * @return bool True, when done with execution.
+ * @return true True, when done with execution.
*/
function add_clean_index($table, $index) {
global $wpdb;
@@ -1727,10 +1812,12 @@ function add_clean_index($table, $index) {
*
* @since 1.3.0
*
+ * @global wpdb $wpdb
+ *
* @param string $table_name The table name to modify.
* @param string $column_name The column name to add to the table.
* @param string $create_ddl The SQL statement used to add the column.
- * @return True if already exists or on successful completion, false on error.
+ * @return bool True if already exists or on successful completion, false on error.
*/
function maybe_add_column($table_name, $column_name, $create_ddl) {
global $wpdb;
@@ -1757,6 +1844,8 @@ function maybe_add_column($table_name, $column_name, $create_ddl) {
*
* @since 4.2.0
*
+ * @global wpdb $wpdb
+ *
* @param string $table The table to convert.
* @return bool true if the table was converted, false if it wasn't.
*/
@@ -1798,6 +1887,8 @@ function maybe_convert_table_to_utf8mb4( $table ) {
*
* @since 1.2.0
*
+ * @global wpdb $wpdb
+ *
* @return stdClass List of options.
*/
function get_alloptions_110() {
@@ -1820,6 +1911,8 @@ function get_alloptions_110() {
* @since 1.5.1
* @access private
*
+ * @global wpdb $wpdb
+ *
* @param string $setting Option name.
* @return mixed
*/
@@ -1879,6 +1972,8 @@ function deslash($content) {
*
* @since 1.5.0
*
+ * @global wpdb $wpdb
+ *
* @param string|array $queries Optional. The query to run. Can be multiple queries
* in an array, or a string of queries separated by
* semicolons. Default empty.
@@ -1951,8 +2046,8 @@ function dbDelta( $queries = '', $execute = true ) {
$global_tables = $wpdb->tables( 'global' );
foreach ( $cqueries as $table => $qry ) {
- // Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
- if ( in_array( $table, $global_tables ) && ( !is_main_site() || defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) ) {
+ // Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.
+ if ( in_array( $table, $global_tables ) && ! wp_should_upgrade_global_tables() ) {
unset( $cqueries[ $table ], $for_update[ $table ] );
continue;
}
@@ -2211,7 +2306,7 @@ function make_site_theme_from_oldschool($theme_name, $template) {
// Don't copy anything.
continue;
- }
+ }
}
if (! @copy("$oldpath/$oldfile", "$site_dir/$newfile"))
@@ -2264,7 +2359,7 @@ function make_site_theme_from_oldschool($theme_name, $template) {
*
* @param string $theme_name The name of the theme.
* @param string $template The directory name of the theme.
- * @return null|false
+ * @return false|void
*/
function make_site_theme_from_default($theme_name, $template) {
$site_dir = WP_CONTENT_DIR . "/themes/$template";
@@ -2403,6 +2498,8 @@ function translate_level_to_role($level) {
* Checks the version of the installed MySQL binary.
*
* @since 2.1.0
+ *
+ * @global wpdb $wpdb
*/
function wp_check_mysql_version() {
global $wpdb;
@@ -2432,6 +2529,9 @@ function maybe_disable_automattic_widgets() {
* Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.
*
* @since 3.5.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function maybe_disable_link_manager() {
global $wp_current_db_version, $wpdb;
@@ -2444,6 +2544,9 @@ function maybe_disable_link_manager() {
* Runs before the schema is upgraded.
*
* @since 2.9.0
+ *
+ * @global int $wp_current_db_version
+ * @global wpdb $wpdb
*/
function pre_schema_upgrade() {
global $wp_current_db_version, $wpdb;
@@ -2461,7 +2564,7 @@ function pre_schema_upgrade() {
}
// Multisite schema upgrades.
- if ( $wp_current_db_version < 25448 && is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && is_main_network() ) {
+ if ( $wp_current_db_version < 25448 && is_multisite() && wp_should_upgrade_global_tables() ) {
// Upgrade verions prior to 3.7
if ( $wp_current_db_version < 25179 ) {
@@ -2479,7 +2582,7 @@ function pre_schema_upgrade() {
// Upgrade versions prior to 4.2.
if ( $wp_current_db_version < 31351 ) {
- if ( ! is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ if ( ! is_multisite() && wp_should_upgrade_global_tables() ) {
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
}
$wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))" );
@@ -2495,6 +2598,8 @@ function pre_schema_upgrade() {
*
* @since 3.0.0
*
+ * @global wpdb $wpdb
+ * @global string $charset_collate
*/
if ( !function_exists( 'install_global_terms' ) ) :
function install_global_terms() {
@@ -2514,3 +2619,49 @@ CREATE TABLE $wpdb->sitecategories (
dbDelta( $ms_queries );
}
endif;
+
+/**
+ * Determine if global tables should be upgraded.
+ *
+ * This function performs a series of checks to ensure the environment allows
+ * for the safe upgrading of global WordPress database tables. It is necessary
+ * because global tables will commonly grow to millions of rows on large
+ * installations, and the ability to control their upgrade routines can be
+ * critical to the operation of large networks.
+ *
+ * In a future iteration, this function may use `wp_is_large_network()` to more-
+ * intelligently prevent global table upgrades. Until then, we make sure
+ * WordPress is on the main site of the main network, to avoid running queries
+ * more than once in multi-site or multi-network environments.
+ *
+ * @since 4.3.0
+ *
+ * @return bool Whether to run the upgrade routines on global tables.
+ */
+function wp_should_upgrade_global_tables() {
+
+ // Return false early if explicitly not upgrading
+ if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
+ return false;
+ }
+
+ // Assume global tables should be upgraded
+ $should_upgrade = true;
+
+ // Set to false if not on main network (does not matter if not multi-network)
+ if ( ! is_main_network() ) {
+ $should_upgrade = false;
+ }
+
+ // Set to false if not on main site of current network (does not matter if not multi-site)
+ if ( ! is_main_site() ) {
+ $should_upgrade = false;
+ }
+
+ /**
+ * Filter if upgrade routines should be run on global tables.
+ *
+ * @param bool $should_upgrade Whether to run the upgrade routines on global tables.
+ */
+ return apply_filters( 'wp_should_upgrade_global_tables', $should_upgrade );
+}
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 49062fc..132ea6d 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -11,7 +11,7 @@
*
* @since 2.0.0
*
- * @return null|WP_Error|int Null when adding user, WP_Error or User ID integer when no parameters.
+ * @return int|WP_Error WP_Error or User ID.
*/
function add_user() {
return edit_user();
@@ -25,10 +25,10 @@ function add_user() {
* @since 2.0.0
*
* @param int $user_id Optional. User ID.
- * @return int user id of the updated user
+ * @return int|WP_Error user id of the updated user
*/
function edit_user( $user_id = 0 ) {
- global $wp_roles;
+ $wp_roles = wp_roles();
$user = new stdClass;
if ( $user_id ) {
$update = true;
@@ -176,7 +176,7 @@ function edit_user( $user_id = 0 ) {
$user_id = wp_update_user( $user );
} else {
$user_id = wp_insert_user( $user );
- wp_new_user_notification( $user_id, isset( $_POST['send_password'] ) ? wp_unslash( $pass1 ) : '' );
+ wp_new_user_notification( $user_id, 'both' );
}
return $user_id;
}
@@ -198,9 +198,7 @@ function edit_user( $user_id = 0 ) {
* @return array
*/
function get_editable_roles() {
- global $wp_roles;
-
- $all_roles = $wp_roles->roles;
+ $all_roles = wp_roles()->roles;
/**
* Filter the list of editable roles.
@@ -236,6 +234,8 @@ function get_user_to_edit( $user_id ) {
*
* @since 2.0.0
*
+ * @global wpdb $wpdb
+ *
* @param int $user_id User ID.
* @return array
*/
@@ -264,6 +264,8 @@ function get_users_drafts( $user_id ) {
*
* @since 2.0.0
*
+ * @global wpdb $wpdb
+ *
* @param int $id User ID.
* @param int $reassign Optional. Reassign posts and links to new User ID.
* @return bool True when finished.
@@ -384,9 +386,12 @@ function wp_revoke_user($id) {
$user->remove_all_caps();
}
-add_action('admin_init', 'default_password_nag_handler');
/**
* @since 2.8.0
+ *
+ * @global int $user_ID
+ *
+ * @param false $errors Deprecated.
*/
function default_password_nag_handler($errors = false) {
global $user_ID;
@@ -401,10 +406,11 @@ function default_password_nag_handler($errors = false) {
}
}
-add_action('profile_update', 'default_password_nag_edit_user', 10, 2);
-
/**
* @since 2.8.0
+ *
+ * @param int $user_ID
+ * @param object $old_data
*/
function default_password_nag_edit_user($user_ID, $old_data) {
// Short-circuit it.
@@ -420,10 +426,10 @@ function default_password_nag_edit_user($user_ID, $old_data) {
}
}
-add_action('admin_notices', 'default_password_nag');
-
/**
* @since 2.8.0
+ *
+ * @global string $pagenow
*/
function default_password_nag() {
global $pagenow;
@@ -434,7 +440,7 @@ function default_password_nag() {
echo '';
echo '
-
+
@@ -82,6 +85,8 @@ function display_header( $body_classes = '' ) {
* Display installer setup form.
*
* @since 2.8.0
+ *
+ * @param string|null $error
*/
function display_setup_form( $error = null ) {
global $wpdb;
@@ -124,16 +129,45 @@ function display_setup_form( $error = null ) {
-
+
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -144,10 +178,10 @@ function display_setup_form( $error = null ) {
-
+
-
+
-+
-+
url ) . '">' . esc_html( $original_title ) . '' ); ?>
@@ -235,6 +237,10 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu { * @uses Walker_Nav_Menu */ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { + /** + * + * @param array $fields + */ public function __construct( $fields = false ) { if ( $fields ) { $this->db_fields = $fields; @@ -280,6 +286,8 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * * @since 3.0.0 * + * @global int $_nav_menu_placeholder + * * @param string $output Passed by reference. Used to append additional content. * @param object $item Menu item data object. * @param int $depth Depth of menu item. Used for padding. @@ -451,18 +459,20 @@ function wp_nav_menu_setup() { add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); // If first time editing, disable advanced items by default. - if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { + if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { $user = wp_get_current_user(); update_user_option($user->ID, 'managenav-menuscolumnshidden', - array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', ), + array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', 4 => 'title-attribute', ), true); } } /** - * Limit the amount of meta boxes to just links, pages and cats for first time users. + * Limit the amount of meta boxes to pages, posts, links, and categories for first time users. * * @since 3.0.0 + * + * @global array $wp_meta_boxes **/ function wp_initial_nav_menu_meta_boxes() { global $wp_meta_boxes; @@ -470,7 +480,7 @@ function wp_initial_nav_menu_meta_boxes() { if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array($wp_meta_boxes) ) return; - $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category' ); + $initial_meta_boxes = array( 'add-page', 'add-post', 'add-custom-links', 'add-category' ); $hidden_meta_boxes = array(); foreach ( array_keys($wp_meta_boxes['nav-menus']) as $context ) { @@ -549,7 +559,7 @@ function wp_nav_menu_taxonomy_meta_boxes() { * * @since 3.6.0 * - * @uses global $one_theme_location_no_menus to determine if no menus exist + * @global bool $one_theme_location_no_menus to determine if no menus exist * * @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu * @return string Disabled attribute if at least one menu exists, false if not @@ -567,6 +577,9 @@ function wp_nav_menu_disabled_check( $nav_menu_selected_id ) { * Displays a metabox for the custom links menu item. * * @since 3.0.0 + * + * @global int $_nav_menu_placeholder + * @global int|string $nav_menu_selected_id */ function wp_nav_menu_item_link_meta_box() { global $_nav_menu_placeholder, $nav_menu_selected_id; @@ -606,6 +619,9 @@ function wp_nav_menu_item_link_meta_box() { * * @since 3.0.0 * + * @global int $_nav_menu_placeholder + * @global int|string $nav_menu_selected_id + * * @param string $object Not used. * @param string $post_type The post type object. */ @@ -712,6 +728,21 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 15 ) ); $most_recent = $get_posts->query( $recent_args ); $args['walker'] = $walker; + + /** + * Filter the posts displayed in the 'Most Recent' tab of the current + * post type's menu items meta box. + * + * The dynamic portion of the hook name, `$post_type_name`, refers to the post type name. + * + * @since 4.3.0 + * + * @param array $most_recent An array of post objects being listed. + * @param array $args An array of WP_Query arguments. + * @param object $post_type The current post type object for this menu item meta box. + */ + $most_recent = apply_filters( "nav_menu_items_{$post_type_name}_recent", $most_recent, $args, $post_type ); + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args ); ?> @@ -849,6 +880,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { * * @since 3.0.0 * + * @global int|string $nav_menu_selected_id + * * @param string $object Not used. * @param string $taxonomy The taxonomy object. */ @@ -1162,7 +1195,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) { $result .= '' . __( 'Add menu items from the column on the left.' ) . '
'; $result .= '
'; /** @@ -1215,6 +1248,7 @@ function wp_nav_menu_manage_columns() { return array( '_title' => __('Show advanced menu properties'), 'cb' => '', + 'title-attribute' => __('Title Attribute'), 'link-target' => __('Link Target'), 'css-classes' => __('CSS Classes'), 'xfn' => __('Link Relationship (XFN)'), @@ -1228,6 +1262,7 @@ function wp_nav_menu_manage_columns() { * @access private * @since 3.0.0 * + * @global wpdb $wpdb */ function _wp_delete_orphaned_draft_menu_items() { global $wpdb; @@ -1239,7 +1274,6 @@ function _wp_delete_orphaned_draft_menu_items() { foreach( (array) $menu_items_to_delete as $menu_item_id ) wp_delete_post( $menu_item_id, true ); } -add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items'); /** * Saves nav menu items @@ -1280,10 +1314,11 @@ function wp_nav_menu_update_menu_items ( $nav_menu_selected_id, $nav_menu_select $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); - if ( is_wp_error( $menu_item_db_id ) ) + if ( is_wp_error( $menu_item_db_id ) ) { $messages[] = '' . $menu_item_db_id->get_error_message() . '
WordPress Plugin Directory or upload a plugin in .zip format via this page.' ), 'https://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>
@@ -148,22 +151,28 @@ function install_dashboard() { } else { //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud() $tags = array(); - foreach ( (array)$api_tags as $tag ) - $tags[ $tag['name'] ] = (object) array( - 'link' => esc_url( self_admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ), - 'name' => $tag['name'], - 'id' => sanitize_title_with_dashes($tag['name']), - 'count' => $tag['count'] ); + foreach ( (array) $api_tags as $tag ) { + $url = self_admin_url( 'plugin-install.php?tab=search&type=tag&s=' . urlencode( $tag['name'] ) ); + $data = array( + 'link' => esc_url( $url ), + 'name' => $tag['name'], + 'slug' => $tag['slug'], + 'id' => sanitize_title_with_dashes( $tag['name'] ), + 'count' => $tag['count'] + ); + $tags[ $tag['name'] ] = (object) $data; + } echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%s plugin'), 'multiple_text' => __('%s plugins') ) ); } echo ''; } -add_action( 'install_plugins_featured', 'install_dashboard' ); /** * Display search form for searching plugins. * * @since 2.7.0 + * + * @param bool $type_selector */ function install_search_form( $type_selector = true ) { $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term'; @@ -209,7 +218,6 @@ function install_plugins_upload() {
%s
'; + $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID ); - $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) ); - $set_thumbnail_link = '%s
'; - $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); + $content = sprintf( $set_thumbnail_link, + esc_attr( $post_type_object->labels->set_featured_image ), + esc_url( $upload_iframe_src ), + esc_html( $post_type_object->labels->set_featured_image ) + ); if ( $thumbnail_id && get_post( $thumbnail_id ) ) { $old_content_width = $content_width; @@ -1360,8 +1382,12 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); if ( !empty( $thumbnail_html ) ) { $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); - $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html ); - $content .= '' . esc_html__( 'Remove featured image' ) . '
'; + $content = sprintf( $set_thumbnail_link, + esc_attr( $post_type_object->labels->set_featured_image ), + esc_url( $upload_iframe_src ), + $thumbnail_html + ); + $content .= '' . esc_html( $post_type_object->labels->remove_featured_image ) . '
'; } $content_width = $old_content_width; } diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index c522ab5..8c84054 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -8,14 +8,17 @@ * @subpackage Administration */ -// Declare these as global in case schema.php is included from a function. +/** + * Declare these as global in case schema.php is included from a function. + * + * @global wpdb $wpdb + * @global array $wp_queries + * @global string $charset_collate + */ global $wpdb, $wp_queries, $charset_collate; /** * The database character collate. - * @var string - * @global string - * @name $charset_collate */ $charset_collate = $wpdb->get_charset_collate(); @@ -24,6 +27,8 @@ $charset_collate = $wpdb->get_charset_collate(); * * @since 3.3.0 * + * @global wpdb $wpdb + * * @param string $scope Optional. The tables for which to retrieve SQL. Can be all, global, ms_global, or blog tables. Defaults to all. * @param int $blog_id Optional. The blog ID for which to retrieve SQL. Default is the current blog ID. * @return string The SQL needed to create the requested tables. @@ -333,7 +338,8 @@ $wp_queries = wp_get_db_schema( 'all' ); * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. - * @uses $wp_db_version + * @global int $wp_db_version + * @global int $wp_current_db_version */ function populate_options() { global $wpdb, $wp_db_version, $wp_current_db_version; @@ -490,6 +496,9 @@ function populate_options() { // 3.5 'link_manager_enabled' => 0, + + // 4.3.0 + 'finished_splitting_shared_terms' => 1, ); // 3.3 @@ -862,6 +871,11 @@ endif; * * @since 3.0.0 * + * @global wpdb $wpdb + * @global object $current_site + * @global int $wp_db_version + * @global WP_Rewrite $wp_rewrite + * * @param int $network_id ID of network to populate. * @return bool|WP_Error True on success, or WP_Error on warning (with the install otherwise successful, * so the error code must be checked) or failure. @@ -917,6 +931,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam $site_admins = get_site_option( 'site_admins' ); } + /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ $welcome_email = __( 'Howdy USERNAME, Your new SITE_NAME site has been successfully set up at: diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index 3572446..fba5dc9 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -11,6 +11,8 @@ * * @since 2.7.0 * + * @staticvar array $column_headers + * * @param string|WP_Screen $screen The screen you want the headers for * @return array Containing the headers in the format id => UI String */ @@ -60,6 +62,8 @@ function get_hidden_columns( $screen ) { * * @since 2.7.0 * + * @global array $wp_meta_boxes + * * @param WP_Screen $screen */ function meta_box_prefs( $screen ) { @@ -73,9 +77,12 @@ function meta_box_prefs( $screen ) { $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 ) { + foreach ( array_keys( $wp_meta_boxes[ $screen->id ] ) as $context ) { + foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) { + if ( ! isset( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] ) ) { + continue; + } + foreach ( $wp_meta_boxes[ $screen->id ][ $context ][ $priority ] as $box ) { if ( false == $box || ! $box['title'] ) continue; // Submit box cannot be hidden @@ -162,6 +169,8 @@ function add_screen_option( $option, $args = array() ) { * * @since 3.1.0 * + * @global WP_Screen $current_screen + * * @return WP_Screen Current screen object */ function get_current_screen() { @@ -179,7 +188,7 @@ function get_current_screen() { * @since 3.0.0 * * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen, - * or an existing screen object. + * or an existing screen object. */ function set_current_screen( $hook_name = '' ) { WP_Screen::get( $hook_name )->set_current_screen(); @@ -323,6 +332,11 @@ final class WP_Screen { /** * Stores old string-based help. + * + * @static + * @access private + * + * @var array */ private static $_old_compat_help = array(); @@ -339,8 +353,11 @@ final class WP_Screen { * The screen object registry. * * @since 3.3.0 - * @var array + * + * @static * @access private + * + * @var array */ private static $_registry = array(); @@ -368,12 +385,15 @@ final class WP_Screen { * @since 3.3.0 * @access public * + * @static + * + * @global string $hook_suffix + * * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen. - * Defaults to the current $hook_suffix global. + * Defaults to the current $hook_suffix global. * @return WP_Screen Screen object. */ public static function get( $hook_name = '' ) { - if ( $hook_name instanceof WP_Screen ) { return $hook_name; } @@ -529,6 +549,10 @@ final class WP_Screen { * * @see set_current_screen() * @since 3.3.0 + * + * @global WP_Screen $current_screen + * @global string $taxnow + * @global string $typenow */ public function set_current_screen() { global $current_screen, $taxnow, $typenow; @@ -560,9 +584,8 @@ final class WP_Screen { * @since 3.5.0 * * @param string $admin The admin to check against (network | user | site). - * If empty any of the three admins will result in true. - * @return boolean True if the screen is in the indicated admin, false otherwise. - * + * If empty any of the three admins will result in true. + * @return bool True if the screen is in the indicated admin, false otherwise. */ public function in_admin( $admin = null ) { if ( empty( $admin ) ) @@ -578,6 +601,8 @@ final class WP_Screen { * * @since 3.3.0 * + * @static + * * @param WP_Screen $screen A screen object. * @param string $help Help text. */ @@ -787,6 +812,8 @@ final class WP_Screen { * This will trigger the deprecated filters for backwards compatibility. * * @since 3.3.0 + * + * @global string $screen_layout_columns */ public function render_screen_meta() { @@ -947,18 +974,24 @@ final class WP_Screen {$msg
"; } +/** + * @since 2.9.0 + * + * @return array + */ function get_plugin_updates() { $all_plugins = get_plugins(); $upgrade_plugins = array(); @@ -249,6 +278,9 @@ function get_plugin_updates() { return $upgrade_plugins; } +/** + * @since 2.9.0 + */ function wp_plugin_update_rows() { if ( !current_user_can('update_plugins' ) ) return; @@ -261,8 +293,13 @@ function wp_plugin_update_rows() { } } } -add_action( 'admin_init', 'wp_plugin_update_rows' ); +/** + * + * @param string $file + * @param array $plugin_data + * @return false|void + */ function wp_plugin_update_row( $file, $plugin_data ) { $current = get_site_transient( 'update_plugins' ); if ( !isset( $current->response[ $file ] ) ) @@ -278,7 +315,12 @@ function wp_plugin_update_row( $file, $plugin_data ) { $wp_list_table = _get_list_table('WP_Plugins_List_Table'); if ( is_network_admin() || !is_multisite() ) { - $active_class = ( is_plugin_active( $plugin_data['plugin'] ) ) ? ' active' : ''; + if ( is_network_admin() ) { + $active_class = is_plugin_active_for_network( $file ) ? ' active': ''; + } else { + $active_class = is_plugin_active( $file ) ? ' active' : ''; + } + echo ''; echo '' . __('Notice:') . ' '; - _e('You’re using the auto-generated password for your account. Would you like to change it to something easier to remember?'); + _e('You’re using the auto-generated password for your account. Would you like to change it?'); echo '
'; printf( '' . __('Yes, take me to my profile page') . ' | ', get_edit_profile_url() . '#password' ); printf( '' . __('No thanks, do not remind me again') . '', '?default_password_nag=0' ); diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index e3b231b..36cf644 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -10,6 +10,9 @@ * Display list of the available widgets. * * @since 2.5.0 + * + * @global array $wp_registered_widgets + * @global array $wp_registered_widget_controls */ function wp_list_widgets() { global $wp_registered_widgets, $wp_registered_widget_controls; @@ -51,6 +54,8 @@ function wp_list_widgets() { * * @since 3.1.0 * @access private + * + * @return int */ function _sort_name_callback( $a, $b ) { return strnatcasecmp( $a['name'], $b['name'] ); @@ -99,6 +104,10 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) { * * @since 2.5.0 * + * @global array $wp_registered_widgets + * + * @staticvar int $i + * * @param array $params * @return array */ @@ -123,7 +132,14 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) { return $params; } -function next_widget_id_number($id_base) { +/** + * + * @global array $wp_registered_widgets + * + * @param string $id_base + * @return int + */ +function next_widget_id_number( $id_base ) { global $wp_registered_widgets; $number = 1; @@ -143,6 +159,10 @@ function next_widget_id_number($id_base) { * * @since 2.5.0 * + * @global array $wp_registered_widgets + * @global array $wp_registered_widget_controls + * @global array $sidebars_widgets + * * @param array $sidebar_args * @return array */ diff --git a/wp-admin/index.php b/wp-admin/index.php index 40c7c7f..9143928 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -93,7 +93,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
+ + +
+'submit' ) ); ?>
' . __( 'Already Installed' ) . '' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '
' . __( 'Log In' ) . '
' ); } +/** + * @global string $wp_version + * @global string $required_php_version + * @global string $required_mysql_version + * @global wpdb $wpdb + */ global $wp_version, $required_php_version, $required_mysql_version; $php_version = phpversion(); @@ -183,6 +223,16 @@ if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) { die( '' . __( 'Configuration Error' ) . '
' . __( 'Your
wp-config.phpfile has an empty database table prefix, which is not supported.' ) . '