Changeset 8572 for trunk/wp-includes/classes.php
- Timestamp:
- 08/06/2008 08:31:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r8510 r8572 91 91 // Look for matches. 92 92 $request_match = $request; 93 foreach ( $rewrite as $match => $query) {93 foreach ( (array) $rewrite as $match => $query) { 94 94 // Don't try to match against AtomPub calls 95 95 if ( $req_uri == 'wp-app.php' ) … … 172 172 } 173 173 174 foreach ( $this->private_query_vars as $var) {174 foreach ( (array) $this->private_query_vars as $var) { 175 175 if (isset($this->extra_query_vars[$var])) 176 176 $this->query_vars[$var] = $this->extra_query_vars[$var]; … … 243 243 function build_query_string() { 244 244 $this->query_string = ''; 245 foreach ( array_keys($this->query_vars) as $wpvar) {245 foreach ( (array) array_keys($this->query_vars) as $wpvar) { 246 246 if ( '' != $this->query_vars[$wpvar] ) { 247 247 $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&'; … … 262 262 global $wp_query; 263 263 // Extract updated query vars back into global namespace. 264 foreach ( $wp_query->query_vars as $key => $value) {264 foreach ( (array) $wp_query->query_vars as $key => $value) { 265 265 $GLOBALS[$key] = $value; 266 266 } … … 351 351 if ( empty($code) ) { 352 352 $all_messages = array(); 353 foreach ( $this->errors as $code => $messages )353 foreach ( (array) $this->errors as $code => $messages ) 354 354 $all_messages = array_merge($all_messages, $messages); 355 355 … … 528 528 * then we got orphans, which should be displayed regardless 529 529 */ 530 if ( ( $max_depth == 0 ) && sizeof( $children_elements ) > 0 ) {530 if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) { 531 531 $empty_array = array(); 532 532 foreach ( $children_elements as $orphans ) … … 751 751 $response = ''; 752 752 if ( is_wp_error($data) ) { 753 foreach ( $data->get_error_codes() as $code ) {753 foreach ( (array) $data->get_error_codes() as $code ) { 754 754 $response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message($code) . "]]></wp_error>"; 755 755 if ( !$error_data = $data->get_error_data($code) ) … … 777 777 778 778 $s = ''; 779 if ( (array) $supplemental) {779 if ( is_array($supplemental) ) { 780 780 foreach ( $supplemental as $k => $v ) 781 781 $s .= "<$k><![CDATA[$v]]></$k>"; … … 801 801 header('Content-Type: text/xml'); 802 802 echo "<?xml version='1.0' standalone='yes'?><wp_ajax>"; 803 foreach ( $this->responses as $response )803 foreach ( (array) $this->responses as $response ) 804 804 echo $response; 805 805 echo '</wp_ajax>';
Note: See TracChangeset
for help on using the changeset viewer.