Skip to content

Commit e32ca19

Browse files
authored
Merge pull request #16 from MEOM/remove/svg-filters
Remove SVG filters.
2 parents 4317bfe + 5348e23 commit e32ca19

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Version 1.4 released February 8, 2023
4+
5+
### Added
6+
- Remove SVG filters.
7+
38
## Version 1.3 released September 22, 2022
49

510
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meom/meom-dodo",
3-
"version": "1.3",
3+
"version": "1.4",
44
"description": "MEOM clean up WP.",
55
"type": "wordpress-muplugin",
66
"license": "GPL-2.0-or-later",

inc/remove-svg-filters.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Remove SVG filters.
4+
*
5+
* @package MEOM Dodo
6+
*/
7+
8+
namespace MEOM\Dodo;
9+
10+
/**
11+
* Remove SVG filters.
12+
*
13+
* @return void
14+
*/
15+
function remove_svg_filters() {
16+
// Allow filtering svg filters.
17+
if ( \apply_filters( 'meom_dodo_remove_svg_filters', true ) ) {
18+
remove_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
19+
}
20+
}
21+
add_action( 'init', __NAMESPACE__ . '\remove_svg_filters' );

meom-dodo.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Author: MEOM
55
* Author URI: https://www.meom.fi/
66
* Description: Clean up WordPress.
7-
* Version: 1.3
7+
* Version: 1.4
88
* License: GPL2 or later.
99
* Text Domain: meom-dodo
1010
* Domain Path: /languages
@@ -25,4 +25,5 @@ function meom_dodo_i18n() {
2525
require_once dirname( __FILE__ ) . '/inc/enqueue-assets.php';
2626
require_once dirname( __FILE__ ) . '/inc/remove-admin-menu-items.php';
2727
require_once dirname( __FILE__ ) . '/inc/remove-editor-settings.php';
28+
require_once dirname( __FILE__ ) . '/inc/remove-svg-filters.php';
2829
require_once dirname( __FILE__ ) . '/inc/user-meta.php';

readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ Example usage:
8282
add_filter( 'meom_dodo_remove_layout_support', '__return_false' );
8383
```
8484

85+
### meom_dodo_remove_svg_filters
86+
87+
Allow SVG filters with the filter `meom_dodo_remove_svg_filters`.
88+
89+
Example usage:
90+
91+
```php
92+
add_filter( 'meom_dodo_remove_svg_filters', '__return_false' );
93+
```
94+
8595
### meom_dodo_add_utility_classes
8696

8797
Remove adding utility classes with the filter `meom_dodo_add_utility_classes`.

0 commit comments

Comments
 (0)