cmb2_get_option
A helper function to get an option from a CMB2 options array.
Description
Returns (array)
Options array or specific field
Parameters (3)
- 0. $option_key (string)
- The option key.
- 1. $field_id — Optional. (string) =>
''
- Option array field key
- 2. $default — Optional. (bool) =>
false
- Default fallback value
Usage
if ( !function_exists( 'cmb2_get_option' ) ) { require_once ABSPATH . PLUGINDIR . 'maps-builder/vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/helper-functions.php'; } // The option key. $option_key = ''; // Option array field key $field_id = ''; // Optional default fallback value $default = false; // NOTICE! Understand what this does before running. $result = cmb2_get_option($option_key, $field_id, $default);
Defined (2)
The function is defined in the following location(s).
- /vendor/wordimpress/maps-builder-core/includes/libraries/metabox/includes/helper-functions.php
- function cmb2_get_option( $option_key, $field_id = '', $default = false ) {
- returncmb2_options $option_key )->get( $field_id, $default );
- }
- /includes/libraries/metabox/includes/helper-functions.php
- function cmb2_get_option( $option_key, $field_id = '' ) {
- returncmb2_options $option_key )->get( $field_id );
- }