mc4wp ( string $service = null )

Get a service by its name

Example:

$forms = mc4wp(‘forms’); $api = mc4wp(‘api’);

When no service parameter is given, the entire container will be returned.

Return: (object)

Source file: functions.php

View source


Parameters

$service

(string) (Optional) (optional)

Default value: null


Used by

Uses


Source

function mc4wp( $service = null ) {
	static $mc4wp;

	if( ! $mc4wp ) {
		$mc4wp = new MC4WP_Container();
	}

	if( $service ) {
		return $mc4wp->get( $service );
	}

	return $mc4wp;
}


User Contributed Notes

You must log in before being able to contribute a note.