CMB2-Snippet-Library icon indicating copy to clipboard operation
CMB2-Snippet-Library copied to clipboard

PHP 5.4 code in a snippet

Open slaFFik opened this issue 7 years ago • 2 comments
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 avatar Feb 17 '18 15:02 slaFFik

@slaFFik the way to get around this would be to assign to a variable first and then reference it via $somevar[0] correct?

tw2113 avatar Oct 19 '18 15:10 tw2113

@tw2113 yes, that's correct.

slaFFik avatar Jan 13 '19 19:01 slaFFik