I think this is a simple question:
I’m building a plugi, and up until now, if i wanted to include a php file, i would have to know the page_id – i would put the following command in page.php (or whatever page template i’m using):
if (is_page(4552)) {
include WP_PLUGIN_DIR .'/file_to_include.php';
}
now, A bit more background: i now have a hook that creates a post on activation, and saves the post_id using update_options. so, that’s how i know what $page_id is.
So, to summarize – how do i dynamically write the code above – in my plugin – assuming I know the $page_id?
Thanks for helping!
Make sure to add it to a hook that fires at or after ‘wp’ ;
Example: