Browse Source

explaining $plugins tests

tokul 20 năm trước cách đây
mục cha
commit
8d11e55aab
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      functions/plugin.php

+ 5 - 0
functions/plugin.php

@@ -198,6 +198,11 @@ function soupNazi(){
 function is_plugin_enabled($plugin_name) {
   global $plugins;
 
+  /**
+   * check if variable is set. can't do is_array(), if variable is not set
+   * check if it is an array
+   * there is no need to call in_array() if $plugins array is empty
+   */
   if (! isset($plugins) || ! is_array($plugins) || empty($plugins))
     return false;