Changeset 31829
- Timestamp:
- 03/19/2015 03:55:39 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r31811 r31829 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 = reset( $_menu_items ); 1095 1095 1096 1096 // Restore the missing menu item properties … … 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 => reset( $settings ) ); 1797 1797 $widget_id = $id_base . '-' . $multi_number; 1798 1798 $sidebar[] = $widget_id; -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r31441 r31829 1905 1905 case 'plugin': 1906 1906 $plugin_data = get_plugins( '/' . $update->slug ); 1907 $plugin_data = array_shift( $plugin_data );1907 $plugin_data = reset( $plugin_data ); 1908 1908 if ( $plugin_data ) 1909 1909 return $plugin_data['Name']; -
trunk/src/wp-admin/includes/media.php
r31799 r31829 622 622 623 623 if ( isset($_POST['send']) ) { 624 $keys = array_keys( $_POST['send']);625 $send_id = (int) array_shift($keys);624 $keys = array_keys( $_POST['send'] ); 625 $send_id = (int) reset( $keys ); 626 626 } 627 627 … … 1358 1358 $post_mime_types = get_post_mime_types(); 1359 1359 $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); 1360 $type = array_shift( $keys );1360 $type = reset( $keys ); 1361 1361 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 1362 1362 -
trunk/src/wp-admin/includes/menu.php
r31300 r31829 95 95 continue; 96 96 $subs = $submenu[$data[2]]; 97 $first_sub = array_shift($subs);97 $first_sub = reset( $subs ); 98 98 $old_parent = $data[2]; 99 99 $new_parent = $first_sub[2]; … … 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 = reset( $subs ); 167 167 if ( $data[2] == $first_sub[2] ) 168 168 unset( $submenu[$data[2]] ); -
trunk/src/wp-admin/includes/ms.php
r31517 r31829 805 805 <?php 806 806 if ( !$found ) { 807 $blog = array_shift( $all_blogs );807 $blog = reset( $all_blogs ); 808 808 update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); 809 809 } 810 810 } elseif ( count( $all_blogs ) == 1 ) { 811 $blog = array_shift( $all_blogs );811 $blog = reset( $all_blogs ); 812 812 echo $blog->domain; 813 813 if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. -
trunk/src/wp-admin/includes/plugin-install.php
r31363 r31829 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 = reset( $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'], '=') ){ … … 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 = reset( $section_titles ); 395 395 } 396 396 -
trunk/src/wp-admin/user-edit.php
r31516 r31829 316 316 // Compare user role against currently editable roles 317 317 $user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) ); 318 $user_role = array_shift( $user_roles );318 $user_role = reset( $user_roles ); 319 319 320 320 // print the full list of roles with the primary one selected. -
trunk/src/wp-admin/widgets.php
r31420 r31829 190 190 // Default to the first sidebar 191 191 $keys = array_keys( $wp_registered_sidebars ); 192 $sidebar = array_shift( $keys );192 $sidebar = reset( $keys ); 193 193 194 194 if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget -
trunk/src/wp-includes/pomo/streams.php
r30663 r31829 41 41 $endian_letter = ('big' == $this->endian)? 'N' : 'V'; 42 42 $int = unpack($endian_letter, $bytes); 43 return array_shift($int);43 return reset( $int ); 44 44 } 45 45 -
trunk/src/wp-includes/post-formats.php
r31168 r31829 27 27 return false; 28 28 29 $format = array_shift( $_format );29 $format = reset( $_format ); 30 30 31 31 return str_replace('post-format-', '', $format->slug ); -
trunk/src/wp-includes/post.php
r31789 r31829 4600 4600 4601 4601 if ( 1 == count( $post_status ) ) { 4602 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], array_shift( $post_status ) );4602 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status = %s", $r['post_type'], reset( $post_status ) ); 4603 4603 } else { 4604 4604 $post_status = implode( "', '", $post_status ); -
trunk/src/wp-includes/query.php
r31458 r31829 4674 4674 if ( count( $post_type ) > 1 ) 4675 4675 return; 4676 $post_type = array_shift( $post_type );4676 $post_type = reset( $post_type ); 4677 4677 } 4678 4678
Note: See TracChangeset
for help on using the changeset viewer.