Skip to content

Commit 228a5c1

Browse files
authored
fix: improve file based execution with namespaced php snippets
2 parents e32ce9d + 37646e3 commit 228a5c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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+
$output = "<?php\n\n" . apply_filters( 'code_snippets_php_snippet_file_code', $code );
16+
return $output;
1617
}
1718
}

0 commit comments

Comments
 (0)