PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.2
WebberZone Top 10 — Popular Posts v4.5.2
4.5.2 4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 All 118 releases
← All changes | includes/util/class-hook-registry.php +4 -4 4.4.0 → 4.5.2 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2 /**
3 3 * Hook Registry class.
4 4 *
5 - * @package WebberZone\Top_Ten\Util
5 + * @package WebberZone\Top_Ten
6 6 */
7 7
8 8 namespace WebberZone\Top_Ten\Util;
9 9
@@ -39,9 +39,9 @@
39 39 public static function register( string $hook_type, string $hook_name, callable $callback, int $priority = 10, int $args = 1 ): bool {
40 40 if ( ! in_array( $hook_type, array( 'action', 'filter' ), true ) ) {
41 41 return false;
42 42 }
43 - if ( empty( trim( $hook_name ) ) ) {
43 + if ( empty( trim( $hook_name, " \t\n\r\0\x0B" ) ) ) {
44 44 return false;
45 45 }
46 46 if ( $priority < 0 ) {
47 47 return false;
@@ -234,10 +234,10 @@
234 234 }
235 235
236 236 if ( is_array( $callback ) ) {
237 237 if ( is_object( $callback[0] ) ) {
238 - $object_hash = spl_object_hash( $callback[0] );
239 - return get_class( $callback[0] ) . '#' . $object_hash . '::' . $callback[1];
238 + $object_id = spl_object_id( $callback[0] );
239 + return get_class( $callback[0] ) . '#' . $object_id . '::' . $callback[1];
240 240 }
241 241 return $callback[0] . '::' . $callback[1];
242 242 }
243 243