Skip to content

Commit 33b924d

Browse files
committed
Content Filter
1 parent d7712b2 commit 33b924d

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ This project is licensed under the GPL3 License.
267267

268268
## Changelog
269269

270-
### 0.5 "xxx"
270+
### 0.5 "Echo"
271271

272272
* Feature: Closing Filter
273273
* Feature: Move Forward Label Filter
@@ -276,6 +276,7 @@ This project is licensed under the GPL3 License.
276276
* Feature: After Loop Filter
277277
* Feature: Mastodon Logo Filter
278278
* Feature: Between Filter
279+
* Feature: Toot Content Filter
279280

280281
### 0.4 "Cassie Lang"
281282

tootpress_blog.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function tootpress_paint_toot( $mastodon_id, $date, $content, $media , $instance
5050

5151
// Toot Content
5252
$content=tootpress_remove_target_blank($content);
53+
$content=tootpress_toot_content_filter_apply($content);
5354
$toot_html.='<div class="toot-content">'.wp_kses($content, tootpress_escaping_allowed_html() ).'</div>';
5455

5556
// Toot Image

tootpress_hooks.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,20 @@ function tootpress_between_filter_apply($content) {
171171
return $content;
172172
}
173173

174+
/**
175+
* Toot Content Filter
176+
*
177+
* This filter can be used to manipulate the toot content
178+
*
179+
* @since 0.5
180+
*
181+
* @param string Content
182+
* @return string Filtered Content
183+
*/
184+
185+
function tootpress_toot_content_filter_apply($content) {
186+
$content=apply_filters( 'tootpress_toot_content_filter', $content );
187+
return $content;
188+
}
189+
174190
?>

tootpress_plugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function tootpress_escaping_allowed_html() {
9797
'class' => array(),
9898
'href' => array(),
9999
'rel' => array(),
100+
'target' => array(),
100101
),
101102
);
102103
}

0 commit comments

Comments
 (0)