private static function doFilter( $action, $class ) {
		$reflection = new \ReflectionClass( $class );
		foreach ( $reflection->getMethods() as $method ) {
			if ( $method->isPublic() && ! $method->isConstructor() ) {
				$comment = $method->getDocComment();

				// No hooks.
				if ( preg_match( '/@nohook[ \t\*\n]+/', $comment ) ) {
					continue;
				}

				// Set hook.
				preg_match_all( '/@hook:?\s+([^\s]+)/', $comment, $matches ) ? $matches[1] : $method->name;
				if ( empty( $matches[1] ) ) {
					$hooks = array( $method->name );
				} else {
					$hooks = $matches[1];
				}

				// Allow setting priority.
				$priority = preg_match( '/@priority:?\s+(\d+)/', $comment, $matches ) ? $matches[1] : 10;

				// Fire.
				foreach ( $hooks as $hook ) {
					call_user_func( $action, $hook, array( $class, $method->name ), $priority, $method->getNumberOfParameters() );
				}
			}
		}
	}
private static function doFilter( $action, $class ) {
		$reflection = new \ReflectionClass( $class );
		foreach ( $reflection->getMethods() as $method ) {
			if ( $method->isPublic() && ! $method->isConstructor() ) {
				$comment = $method->getDocComment();

				// No hooks.
				if ( preg_match( '/@nohook[ \t\*\n]+/', $comment ) ) {
					continue;
				}

				// Set hook.
				preg_match_all( '/@hook:?\s+([^\s]+)/', $comment, $matches ) ? $matches[1] : $method->name;
				if ( empty( $matches[1] ) ) {
					$hooks = array( $method->name );
				} else {
					$hooks = $matches[1];
				}

				// Allow setting priority.
				$priority = preg_match( '/@priority:?\s+(\d+)/', $comment, $matches ) ? $matches[1] : 10;

				// Fire.
				foreach ( $hooks as $hook ) {
					call_user_func( $action, $hook, array( $class, $method->name ), $priority, $method->getNumberOfParameters() );
				}
			}
		}
	}
private static function doFilter ( $ action , $ class ) { $ reflection = new \ ReflectionClass ( $ class ) ; foreach ( $ reflection -> getMethods ( ) as $ method ) { if ( $ method -> isPublic ( ) && ! $ method -> isConstructor ( ) ) { $ comment = $ method -> getDocComment ( ) ; // No hooks. if ( preg_match ( '/@nohook[ \t\*\n]+/' , $ comment ) ) { continue ; } // Set hook. preg_match_all ( '/@hook:?\s+([^\s]+)/' , $ comment , $ matches ) ? $ matches [ 1 ] : $ method -> name ; if ( empty ( $ matches [ 1 ] ) ) { $ hooks = array ( $ method -> name ) ; } else { $ hooks = $ matches [ 1 ] ; } // Allow setting priority. $ priority = preg_match ( '/@priority:?\s+(\d+)/' , $ comment , $ matches ) ? $ matches [ 1 ] : 10 ; // Fire. foreach ( $ hooks as $ hook ) { call_user_func ( $ action , $ hook , array ( $ class , $ method -> name ) , $ priority , $ method -> getNumberOfParameters ( ) ) ; } } } }
Process hooks.

This sets up our automatic filter binding.

@since  1.0.0

@param  string $action Action name.
@param  string $class  Class name.

@return null
Process hooks .