How to get the page id in custom plugin of wordpress

I’m new to the world of Php and word-press.
I want to edit the plugin with the page id.
I tried following options to get the page id but i couldn’t get out nothing.

get_the_ID()
$post->ID
var_dump($wp_query)

all returns null.

Read More

The php file which i’m editing is inside a folder called inludes of plugin folder

But get_the_ID() is working fine in a php file which is in outside of this folder and that is the root folder of the plugin.

plugin folder
  include
     edit_page.php(Here i'm facing problem) 
 plugin.php

Your prompt response would be highly appreciated.

Thanks in advance.

Related posts

Leave a Reply

1 comment