예제 #1
0
 /**
  * @param $filter
  * @param $callback
  * @param int $priority
  */
 public static function unregister($filter, $callback, $priority = 100)
 {
     if (!isset(self::$FilterSections[$filter]['handler'])) {
         if (!isset(self::$FilterSections)) {
             self::$FilterSections = [];
         }
         $id = generate_hash_for_array($callback);
         unset(self::$FilterSections[$filter][$priority][$id]);
         return;
     }
 }
예제 #2
0
파일: View.php 프로젝트: ArtOfWP/CloudLess
 /**
  * Register a section.
  *
  * @param $section
  * @param $callback
  * @param int $priority
  */
 public static function register($section, $callback, $priority = 100)
 {
     if (!isset(self::$ViewSections[$section]['handler'])) {
         if (!isset(self::$ViewSections)) {
             self::$ViewSections = array();
         }
         $id = generate_hash_for_array($callback);
         self::$ViewSections[$section][$priority][$id] = $callback;
         return;
     }
     $handler = self::$ViewSections[$section]['handler'];
     call_user_func($handler, $section, $callback);
 }
예제 #3
0
파일: Hook.php 프로젝트: ArtOfWP/CloudLess
 /**
  * @param $hook
  * @param $callback
  * @param int $priority
  */
 public static function removeCallback($hook, $callback, $priority = 100)
 {
     $id = generate_hash_for_array($callback);
     unset(self::$Hooks[$hook][$priority][$id]);
 }