| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FilterEverything\Filter; |
| 4 | 4 | |
| 5 | -if ( ! defined('WPINC') ) { | |
| 6 | - wp_die(); | |
| 5 | +if ( ! defined('ABSPATH') ) { | |
| 6 | + exit; | |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | class TemplateManager |
| 10 | 10 | { |
| @@ -24,8 +24,10 @@ | ||
| 24 | 24 | public function includeAdminView( $path, array $variables = [] ) |
| 25 | 25 | { |
| 26 | 26 | $file = $this->pluginRootDir . 'views/admin/' . $path . '.php'; |
| 27 | 27 | |
| 28 | + $file = apply_filters( 'wpc_include_admin_view', $file, $path, $variables ); | |
| 29 | + | |
| 28 | 30 | if( file_exists( $file ) ){ |
| 29 | 31 | extract( $variables ); |
| 30 | 32 | include $file; |
| 31 | 33 | } |
| @@ -39,16 +41,12 @@ | ||
| 39 | 41 | if( '' === $file ){ |
| 40 | 42 | $file = $this->pluginRootDir . 'views/frontend/' . $path . '.php'; |
| 41 | 43 | } |
| 42 | 44 | |
| 45 | + $file = apply_filters( 'wpc_include_front_view', $file, $path, $variables ); | |
| 46 | + | |
| 43 | 47 | if( file_exists( $file ) ){ |
| 44 | 48 | extract( $variables ); |
| 45 | 49 | include $file; |
| 46 | 50 | } |
| 47 | 51 | } |
| 48 | - | |
| 49 | - public function locateTemplate( $path ) | |
| 50 | - { | |
| 51 | - | |
| 52 | - } | |
| 53 | - | |
| 54 | 52 | } |