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 +5 -5 4.3.1 → 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;
@@ -162,9 +162,9 @@
162 162 * @param string $hook_name The hook name.
163 163 * @param callable $callback The callback function.
164 164 * @param int $priority Priority of the hook.
165 165 *
166 - * @return bool True if removed, false if not found or invalid hook.
166 + * @return bool True if removed, false if not found or removal failed.
167 167 */
168 168 public static function remove_action( $hook_name, $callback, $priority = 10 ) {
169 169 return self::remove( 'action', $hook_name, $callback, $priority );
170 170 }
@@ -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