modify page title using post data and inline php
-
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. This code exists in the PHP on my page. I just need to be able to change the meta description and page title on the fly with POST data but only when POST data defined for use as title exists.
add_filter(‘wp_title’, ‘set_page_title’);
function set_page_title($orig_title) {
return ‘Modified ‘ . $orig_title;
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘modify page title using post data and inline php’ is closed to new replies.