I would like to know what $_registered_pages does and where am I supposed to use it.
p.s was unable to find any documentation on it online.
The leading underscore indicates you should not use it for anything. It is private and might change its name any time without warning. So do not use it in your own code, that will break one day.