wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_parse_args › WordPress Function
Depuis2.2.0
Dépréciéen/a
› wp_parse_args ( $args, $defaults = array() )
Paramètres: (2) |
|
Retourne: |
|
Défini(e) dans: |
|
Codex: | |
Changelog: |
|
Merges user defined arguments into defaults array.
This function is used throughout WordPress to allow for both string or array to be merged into another array.Fonctions en relation: wp_parse_url, wp_parse_str, wp_parse_list, wp_parse_id_list, wp_paused_plugins
Source
function wp_parse_args( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) { $parsed_args =& $args; } else { wp_parse_str( $args, $parsed_args ); } if ( is_array( $defaults ) && $defaults ) { return array_merge( $defaults, $parsed_args ); } return $parsed_args; }