class-fwp-final-output.php
40 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class FWP_Final_Output_1x0x0 |
| 4 | * |
| 5 | * @package FWP |
| 6 | * @category WordPress Library |
| 7 | * @version 1.0.0 |
| 8 | |
| 9 | * @link https://www.webfactoryltd.com/ |
| 10 | */ |
| 11 | class FWP_Final_Output_1x0x0 extends WPRun_Base_1x0x0 |
| 12 | { |
| 13 | |
| 14 | const FILTER_NAME = 'final_output'; |
| 15 | |
| 16 | /** |
| 17 | * Action for "init" |
| 18 | */ |
| 19 | protected function action_init() |
| 20 | { |
| 21 | ob_start( $this->get_callback( 'apply' ) ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Apply filters |
| 26 | * @param string $content |
| 27 | * @return string |
| 28 | */ |
| 29 | protected function apply( $content ) |
| 30 | { |
| 31 | $filtered_content = apply_filters( self::FILTER_NAME, $content ); |
| 32 | |
| 33 | // remove filters after applying to prevent multiple applies |
| 34 | remove_all_filters( self::FILTER_NAME ); |
| 35 | |
| 36 | return $filtered_content; |
| 37 | } |
| 38 | |
| 39 | } |
| 40 |