PHP Location: headers will not work once any output has occurred. When you try, it generates a “Headers already sent” warning in your error log. When developing custom code, consider defining WP_DEBUG
as true
in wp-config.php. You’ll then see warnings right on the page so you can take corrective action. Just remember to set it as false
on any publicly accessible site if you are not actively developing code.
You can selectively refresh a page with JavaScript after any particular event. If you are refreshing only to update a meta value, using Ajax would be an ideal approach. Admin area Ajax is very similar to front end Ajax. The principal difference is your JavaScript gets enqueued from the “admin_enqueue_scripts” action instead of “wp_enqueue_scripts”.
BTW, please don’t @ reference other members unless they are already involved in your topic. It’s contrary to the concept of community support to seek out the attention of a particular member. It’s even seen by some as a bit spammy. We know @ references are common practice in other forums, hence it’s tolerated if one is already contributing to a topic. It really unnecessary even then since members can subscribe to topics in order to receive notifications if they so choose. Moderators use @ references to help ensure members get notice of important moderator communication. Other usage is really unnecessary.