# content-control/trunk/inc/functions/utils.php

Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks &amp; More, version trunk. 34 lines.

- Page: https://pluginprobe.com/plugins/content-control/trunk/code/inc/functions/utils.php
- Raw: https://pluginprobe.com/plugins/content-control/trunk/raw/inc/functions/utils.php
- Modified: 2024-03-17T23:33:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/content-control/trunk/code/inc/functions/utils.php#L10-L20`.

```php
<?php
/**
 * Utility functions.
 *
 * @package ContentControl
 */

namespace ContentControl;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Check if an addon is installed.
 *
 * @param string $plugin_basename Plugin slug.
 *
 * @return bool
 */
function is_plugin_installed( $plugin_basename ) {
	static $installed_plugins = null;

	if ( null === $installed_plugins ) {
		if ( ! function_exists( 'get_plugins' ) ) {
			require_once ABSPATH . 'wp-admin/includes/plugin.php';
		}

		$installed_plugins = \get_plugins();
	}

	return isset( $installed_plugins[ $plugin_basename ] );
}

```
