diff --git a/wp-includes/functions.php b/wp-includes/functions.php index fff1dcc198..e6815bf20a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1469,6 +1469,24 @@ function smilies_init() { } } +function wp_parse_args( $args, $defaults = '' ) { + if ( is_array($args) ) : + $r =& $args; + else : + parse_str( $args, $r ); + if ( get_magic_quotes_gpc() ) + $r = stripslashes_deep( $r ); + endif; + + if ( is_array($defaults) ) : + extract($defaults); + extract($r); + return compact(array_keys($defaults)); // only those options defined in $defaults + else : + return $r; + endif; +} + function wp_maybe_load_widgets() { if ( !function_exists( 'dynamic_sidebar' ) ) { require_once ABSPATH . WPINC . '/widgets.php';