Ticket #31259: 31259.patch
File 31259.patch, 8.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
1091 1091 } 1092 1092 1093 1093 $_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) ); 1094 $_menu_item = array_shift( $_menu_items );1094 $_menu_item = current( $_menu_items ); 1095 1095 1096 1096 // Restore the missing menu item properties 1097 1097 $menu_item_data['menu-item-description'] = $_menu_item->description; … … 1793 1793 if ( !$multi_number ) 1794 1794 wp_die( $error ); 1795 1795 1796 $_POST[ 'widget-' . $id_base] = array( $multi_number => array_shift($settings) );1796 $_POST[ 'widget-' . $id_base ] = array( $multi_number => current( $settings ) ); 1797 1797 $widget_id = $id_base . '-' . $multi_number; 1798 1798 $sidebar[] = $widget_id; 1799 1799 } -
src/wp-admin/includes/class-wp-upgrader.php
1904 1904 break; 1905 1905 case 'plugin': 1906 1906 $plugin_data = get_plugins( '/' . $update->slug ); 1907 $plugin_data = array_shift( $plugin_data );1907 $plugin_data = current( $plugin_data ); 1908 1908 if ( $plugin_data ) 1909 1909 return $plugin_data['Name']; 1910 1910 break; -
src/wp-admin/includes/media.php
617 617 $errors = null; 618 618 619 619 if ( isset($_POST['send']) ) { 620 $keys = array_keys( $_POST['send']);621 $send_id = (int) array_shift($keys);620 $keys = array_keys( $_POST['send'] ); 621 $send_id = (int) current( $keys ); 622 622 } 623 623 624 624 if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { … … 1346 1346 1347 1347 $post_mime_types = get_post_mime_types(); 1348 1348 $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); 1349 $type = array_shift( $keys );1349 $type = current( $keys ); 1350 1350 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 1351 1351 1352 1352 $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] ); -
src/wp-admin/includes/menu.php
94 94 if ( empty($submenu[$data[2]]) ) 95 95 continue; 96 96 $subs = $submenu[$data[2]]; 97 $first_sub = array_shift($subs);97 $first_sub = current($subs); 98 98 $old_parent = $data[2]; 99 99 $new_parent = $first_sub[2]; 100 100 /* … … 163 163 */ 164 164 if ( ! empty( $submenu[$data[2]] ) && 1 == count ( $submenu[$data[2]] ) ) { 165 165 $subs = $submenu[$data[2]]; 166 $first_sub = array_shift($subs);166 $first_sub = current($subs); 167 167 if ( $data[2] == $first_sub[2] ) 168 168 unset( $submenu[$data[2]] ); 169 169 } -
src/wp-admin/includes/ms.php
795 795 </select> 796 796 <?php 797 797 if ( !$found ) { 798 $blog = array_shift( $all_blogs );798 $blog = current( $all_blogs ); 799 799 update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); 800 800 } 801 801 } elseif ( count( $all_blogs ) == 1 ) { 802 $blog = array_shift( $all_blogs );802 $blog = current( $all_blogs ); 803 803 echo $blog->domain; 804 804 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. 805 805 update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); -
src/wp-admin/includes/plugin-install.php
304 304 $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug); 305 305 } else { 306 306 $key = array_keys( $installed_plugin ); 307 $key = array_shift( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers307 $key = current( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers 308 308 $update_file = $api->slug . '/' . $key; 309 309 if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){ 310 310 $status = 'latest_installed'; … … 391 391 $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English. 392 392 if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) { 393 393 $section_titles = array_keys( (array) $api->sections ); 394 $section = array_shift( $section_titles );394 $section = current( $section_titles ); 395 395 } 396 396 397 397 iframe_header( __( 'Plugin Install' ) ); -
src/wp-admin/user-edit.php
326 326 <?php 327 327 // Compare user role against currently editable roles 328 328 $user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) ); 329 $user_role = array_shift( $user_roles );329 $user_role = current( $user_roles ); 330 330 331 331 // print the full list of roles with the primary one selected. 332 332 wp_dropdown_roles($user_role); -
src/wp-admin/widgets.php
189 189 if ( isset($_GET['addnew']) ) { 190 190 // Default to the first sidebar 191 191 $keys = array_keys( $wp_registered_sidebars ); 192 $sidebar = array_shift( $keys );192 $sidebar = current( $keys ); 193 193 194 194 if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget 195 195 // Copy minimal info from an existing instance of this widget to a new instance -
src/wp-includes/pomo/streams.php
40 40 return false; 41 41 $endian_letter = ('big' == $this->endian)? 'N' : 'V'; 42 42 $int = unpack($endian_letter, $bytes); 43 return array_shift($int);43 return current($int); 44 44 } 45 45 46 46 /** -
src/wp-includes/post-formats.php
26 26 if ( empty( $_format ) ) 27 27 return false; 28 28 29 $format = array_shift( $_format );29 $format = current( $_format ); 30 30 31 31 return str_replace('post-format-', '', $format->slug ); 32 32 } -
src/wp-includes/post.php
4568 4568 } 4569 4569 4570 4570 if ( 1 == count( $post_status ) ) { 4571 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], array_shift( $post_status ) );4571 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], current( $post_status ) ); 4572 4572 } else { 4573 4573 $post_status = implode( "', '", $post_status ); 4574 4574 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $r['post_type'] ); -
src/wp-includes/query.php
4671 4671 if ( is_array( $post_type ) ) { 4672 4672 if ( count( $post_type ) > 1 ) 4673 4673 return; 4674 $post_type = array_shift( $post_type );4674 $post_type = current( $post_type ); 4675 4675 } 4676 4676 4677 4677 // Do not attempt redirect for hierarchical post types