CMB2-Snippet-Library
CMB2-Snippet-Library copied to clipboard
PHP 5.4 code in a snippet
trafficstars
This snippet: https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php - will work correctly on PHP 5.4 and above, because of this $cmb->options_page_keys()[0].
Older PHP will fatal.
@slaFFik the way to get around this would be to assign to a variable first and then reference it via $somevar[0] correct?
@tw2113 yes, that's correct.