/** * Adds fields. * * @internal * @since 0.5.0 * @param array $fields the fields to add as $field_slug => $field_args * @param WPPTD\Components\Metabox $metabox the metabox to add the fields to */ protected function add_fields($fields, $metabox) { foreach ($fields as $field_slug => $field_args) { $field = $metabox->add(new Field($field_slug, $field_args)); if (is_wp_error($field)) { self::doing_it_wrong(__METHOD__, $field->get_error_message(), '0.5.0'); } } }