Two Types of settings in WP – The Doubt

The 2nd example isn’t a different type of setting, it’s just an array of data that the plugin will probably turn into settings somewhere else in the code. I can’t tell from just this code exactly what type of settings it will use or how it does that.

The actual two types of settings are the Settings API, and the Customize API. Your first block of code is using the Settings API.

The Settings API should be used for back-end admin settings pages. The Customize API should be used for adding settings for things that are visible on the front-end.

For theme options specifically, the wordpress.org theme repository requires use of the Customize API, and not the Settings API.

Another thing to consider is that 3rd-party plugins might have their own APIs for adding settings to them. WooCommerce, for example, has its own way of adding settings to the WooCommerce settings pages (although under the hood it’s just the Settings API). Your 2nd block of code might be intended for use in the WooCommerce API.