Skip to content

Commit d4c350c

Browse files
authored
fix: improve file based execution with namespaced PHP snippets
1 parent e32ce9d commit d4c350c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/php/flat-files/handlers/php-snippet-handler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public function get_dir_name(): string {
1212
}
1313

1414
public function wrap_code( string $code ): string {
15-
return "<?php\n\nif ( ! defined( 'ABSPATH' ) ) { return; }\n\n" . $code;
15+
$code = "<?php\n\n" . $code;
16+
return apply_filters( 'code_snippets_php_snippet_file_code', $code );
1617
}
1718
}

0 commit comments

Comments
 (0)