I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the page output and it works great but if I try to insert POST data in the following function to alter the page it doesn't do anything. I just need to be able to change the meta description and page title on the fly with POST data.
This code exists in the PHP on my page:
add_filter('wp_title', 'set_page_title');
function set_page_title($orig_title) {
return 'Modified ' . $orig_title;
}