I can see ‘mbizpa.php’ on the database (and the mbizpa.php template is selected), but the condition is never true.
I tried executing the same condition later in my plugin (at the spot where I do displays), and it works fine. The condition is true and I can display the ‘mbizpa.php’ value. I even displayed it in hex to make sure there is no blank space I cant see on the db. Nope, it’s fine.
When I change the condition to:
if (get_post_meta($post->ID,'_wp_page_template', true) != 'mbizpa.php')
Of course, the metabox is displayed on all page edit screens.
– Would there be an easy way to display the value of _wp_page_template in a popup (alert box) for debug?
– Why can’t get the value of _wp_page_template right at the start of my plugin execution?