Add hook to allow extensions to modify the LonelyPages query