Element_Type_Manager::__construct( string $prefix, array $services )

Constructor.

Description

Parameters

$prefix

(string) (Required) The instance prefix.

$services

(array) (Required) Array of service instances.

  • 'elements'
    (Element_Manager) The element manager instance.
  • 'assets'
    (Assets) The assets instance.
  • 'error_handler'
    (Error_Handler) The error handler instance.

Source

File: src/db-objects/elements/element-types/element-type-manager.php

	public function __construct( $prefix, $services ) {
		$this->set_prefix( $prefix );
		$this->set_services( $services );
		$this->setup_hooks();

		Field_Manager::register_field_type( 'torrochoices', Choices_Field::class );

		$this->default_element_types = array(
			'textfield'      => Base\Textfield::class,
			'textarea'       => Base\Textarea::class,
			'content'        => Base\Content::class,
			'dropdown'       => Base\Dropdown::class,
			'onechoice'      => Base\Onechoice::class,
			'multiplechoice' => Base\Multiplechoice::class,
			'media'          => Base\Media::class,
			'checkbox'       => Base\Checkbox::class,
		);
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.