Get the page ID if the page content has a shortcode
If you want to get the page ID you need to use the $post global. À simple example function my_function(){ global $post; $post_id = $post->ID; // Etc } Note that it can return a null value for certains types of page (archive).