A filter hook for the whole output of the entire page, which is not built in the WordPress Core. For developers or more advanced WP site owners.
| Author: | Victor Villaverde Laan (profile at wordpress.org) |
| WordPress version required: | 3.6.0 |
| WordPress version tested: | 4.2.5 |
| Plugin version: | 1.1.0 |
| Added to WordPress repository: | 09-07-2015 |
| Last updated: | 19-10-2015
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
| Rating, %: | 0 |
| Rated by: | 0 |
| Plugin URI: | http://www.freelancephp.net/wp-filter-final-o... |
| Total downloads: | 62 |
![]() Click to start download |
|
Adds the filter hook final_output for the whole output of the entire page and a filter hook widget_output for all widgets. The WordPress Core doesn't contain such filters. For developers or more advanced WP site owners.
What does it do?
You can use the filter final_output to change the whole output of the page (f.e. the html).
That way you could make modifications before the page is sent to the visitors' browser.
add_filter('final_output', 'wp_replace_at_sign', 10, 1);
function wp_replace_at_sign($content) {
$content = str_replace('@', '[at]', $content);
return $content;
}
The plugin also provides the filter widget_output to filter all widgets.
add_filter('widget_output', 'wp_replace_b_tags', 10, 1);
function wp_replace_b_tags($content) {
$content = str_replace('<b>', '<strong>', $content);
$content = str_replace('</b>', '</strong>', $content);
return $content;
}
How does it work?
You only have to install and activate the plugin to make it work. The filters are enabled by default.
When activated you can change the output of the entire page by using the final_output filter.
