How to get current page id through the plugin
Take a look at the Plugin API/Action Reference, particularly the section Actions Run During a Typical Request. In WordPress, you’re going to want to hook your code to various specific points of execution, otherwise it will be executed immediately, which is often not the desired result. The code you posted is going to be executed … Read more