Merge Settings Into an Array in WordPress

Arrays Merging

Arrays Merging

I found people are coming to this site (to an unrelated article) looking for a way to merge settings into an array.

You’re looking for `wp_parse_args()`

The main function for WordPress to do this is `wp_parse_args()`. You likely want this function.

Learn more about `wp_parse_args()`

Also consider `shortcode_atts()`

This is used for parsing shortcode options. It only supports defined arguments.

Learn more about `shortcode_atts()`

Author: Zack Katz

Zack Katz is the President of Katz Web Services and the developer of WordPress plugins with over 700,000 downloads. He lives in Southwest Colorado with his wife and two cats.

3 thoughts on “Merge Settings Into an Array in WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *