How to get the post-ID in my plugin?
There are several issues with your code. Let’s start at the beginning… Adding hooks All your hooks will be added at the backend. Even those which are outside the if((is_admin)) branch. Add your hooks explicitly where they should work: if (is_admin()){ // do this on backend (admin side) /* load plugin functions */ add_action(‘add_meta_boxes’, ‘myplugin_add_meta_box’); … Read more