Returns a specific registered element type.
Description
See also
Parameters
- $slug
-
(string) (Required) Element type slug.
Return
(awsmug\Torro_Forms\DB_Objects\Elements\Element_Types\Element_Type|awsmug\Torro_Forms\Error) Element type instance, or error object if element type is not registered.
Source
File: src/db-objects/elements/element-types/element-type-manager.php
public function get( $slug ) { if ( ! $this->has( $slug ) ) { /* translators: %s: element type slug */ return new Error( $this->get_prefix() . 'element_type_not_exist', sprintf( __( 'An element type with the slug %s does not exist.', 'torro-forms' ), $slug ), __METHOD__, '1.0.0' ); } return $this->element_types[ $slug ]; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |