Returns a specific registered submodule.
Description
See also
Parameters
- $slug
-
(string) (Required) Submodule slug.
Return
(awsmug\Torro_Forms\Modules\Submodule|awsmug\Torro_Forms\Error) Submodule instance, or error object if submodule is not registered.
Source
File: src/modules/submodule-registry-trait.php
public function get( $slug ) { if ( ! $this->has( $slug ) ) { /* translators: %s: submodule slug */ return new Error( $this->get_prefix() . 'submodule_not_exist', sprintf( __( 'An submodule with the slug %s does not exist.', 'torro-forms' ), $slug ), __METHOD__, '1.0.0' ); } return $this->submodules[ $slug ]; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |