shakerIsInstalled (function)

Last updated: Fri, May 26, 2023 10:49 am
Return to Knowledgebase


The shakerIsInstalled function in UserSpice is used to check if a shaker item (translation, plugin, widget, or template) is installed.




# Parameter Data Type Required Description
1 $type string Yes The type of shaker item (translation, plugin, widget, or template).
2 $reserved string Yes The name or identifier of the shaker item.


Data Type Description of Returned Data
bool Returns true if the shaker item is installed, false otherwise.

Further Documentation:

// Check if a plugin named "example_plugin" is installed
$type = 'plugin';
$reserved = 'example_plugin';
$isInstalled = shakerIsInstalled($type, $reserved);

if ($isInstalled) {
echo "The plugin is installed.";
} else {
echo "The plugin is not installed.";

In the example above, the shakerIsInstalled function is called to check if a plugin named "example_plugin" is installed. The function returns a boolean value indicating whether the plugin is installed or not. The result is stored in the $isInstalled variable. Then, a simple conditional statement is used to display a message based on the installation status of the plugin.