소스 검색

explaining $plugins tests

tokul 20 년 전
부모
커밋
8d11e55aab
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  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;