Changeset 5415 for trunk/wp-includes/functions.php
- Timestamp:
- 05/09/2007 04:19:19 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r5411 r5415 1491 1491 1492 1492 function wp_parse_args( $args, $defaults = '' ) { 1493 if ( is_array( $args) ) :1493 if ( is_array( $args ) ) { 1494 1494 $r =& $args; 1495 else :1495 } else { 1496 1496 parse_str( $args, $r ); 1497 if ( get_magic_quotes_gpc() ) 1497 if ( get_magic_quotes_gpc() ) { 1498 1498 $r = stripslashes_deep( $r ); 1499 endif; 1500 1501 if ( is_array($defaults) ) : 1502 extract($defaults); 1503 extract($r); 1504 return compact(array_keys($defaults)); // only those options defined in $defaults 1505 else : 1499 } 1500 } 1501 1502 if ( is_array( $defaults ) ) { 1503 extract( $defaults ); 1504 extract( $r ); 1505 // Note: this only returns the variables that were in $defaults 1506 // to begin with. All other variables are discarded. 1507 return compact( array_keys( $defaults ) ); 1508 } else { 1506 1509 return $r; 1507 endif;1510 } 1508 1511 } 1509 1512
Note: See TracChangeset
for help on using the changeset viewer.