PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / trunk
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
content-control / inc / functions / utils.php

utils.php in Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More trunk, at inc/functions/utils.php

34 lines 584 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Utility functions.
4 *
5 * @package ContentControl
6 */
7
8 namespace ContentControl;
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit;
12 }
13
14 /**
15 * Check if an addon is installed.
16 *
17 * @param string $plugin_basename Plugin slug.
18 *
19 * @return bool
20 */
21 function is_plugin_installed( $plugin_basename ) {
22 static $installed_plugins = null;
23
24 if ( null === $installed_plugins ) {
25 if ( ! function_exists( 'get_plugins' ) ) {
26 require_once ABSPATH . 'wp-admin/includes/plugin.php';
27 }
28
29 $installed_plugins = \get_plugins();
30 }
31
32 return isset( $installed_plugins[ $plugin_basename ] );
33 }
34