ap_parse_args( array $args, array $defaults = array() )
Description #
Merges user defined array arguments into the defaults array, which works with arrays only.
Parameters #
- $argsarray (Required) Value to be merged with the defaults array.
- $defaultsarray (Optional) Array that serves as the defaults. Default value: array()
Source #
File: includes/functions.php
function ap_parse_args( array $args, $defaults = array() ) { $new_args = $defaults; foreach ( $args as $key => $value ) { if ( is_array( $value ) && isset( $new_args[ $key ] ) ) { $new_args[ $key ] = ap_parse_args( $value, $new_args[ $key ] ); } else { $new_args[ $key ] = $value; } } return $new_args; }
Expand full source code Collapse full source code View on GitHub: includes/functions.php:2518
Add your comment