Module_Manager::get( string $slug )

Returns a specific registered module.

Description

See also

Parameters

$slug

(string) (Required) Module slug.

Return

(awsmug\Torro_Forms\Modules\Module|awsmug\Torro_Forms\Error) Module instance, or error object if module is not registered.

Source

File: src/modules/module-manager.php

	public function get( $slug ) {
		if ( ! isset( $this->modules[ $slug ] ) ) {
			/* translators: %s: module slug */
			return new Error( $this->get_prefix() . 'module_not_exist', sprintf( __( 'A module with the slug %s does not exist.', 'torro-forms' ), $slug ), __METHOD__, '1.0.0' );
		}

		return $this->modules[ $slug ];
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.