configs[] = $config; } /** * Autoload CMB2 */ public function autoload() { foreach ( $this->configs as $config ) { $this->load_cmb2( $config ); } } /** * Load CMB2 * * @param array $config Configuration array for CMB2 */ public function load_cmb2( array $config ) { /** * This prevents that the CMB2 autoload the fields itself. */ $fields = $config['fields']; unset( $config['fields'] ); $this->cmb = new_cmb2_box( array_merge( $this->config_default, $config ) ); $this->generate_fields( $this->cmb, $fields ); } }