Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class CoreSecurity implements Initializable |
||
15 | { |
||
16 | /** |
||
17 | * Initialize module (perform any tasks that should be done init hook). |
||
18 | */ |
||
19 | public function init() |
||
20 | { |
||
21 | // Remove the WordPress version from the <head> tag |
||
22 | add_filter('the_generator', '__return_empty_string'); |
||
|
|||
23 | // remove really simple discovery link |
||
24 | remove_action('wp_head', 'rsd_link'); |
||
25 | |||
26 | // remove version from assets url. |
||
27 | add_filter('style_loader_src', [$this, 'remove_wp_ver_css_js'], 9999); |
||
28 | add_filter('script_loader_src', [$this, 'remove_wp_ver_css_js'], 9999); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * remove version from assets url. |
||
33 | * |
||
34 | * @param $src |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public function remove_wp_ver_css_js($src) |
||
45 | } |
||
46 | } |
||
47 |