Skip to content

Commit 3f47ec0

Browse files
committed
Elephant Filter
1 parent faefe3d commit 3f47ec0

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ This project is licensed under the GPL3 License.
274274
* Feature: Move Forward Label Filter
275275
* Feature: Move Backward Label Filter
276276
* Feature: Before Loop Filter
277+
* Feature: After Loop Filter
278+
* Feature: Mastodon Logo Filter
277279

278280
### 0.4 "Cassie Lang"
279281

tootpress_blog.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ function tootpress_paint_elephant( $instance, $account, $mastodon_id, $backlink)
144144
}
145145

146146
// The Elephant
147-
$elephant_html.='<img class="tootpress-toot-symbol" src="'.esc_url(plugins_url()).'/tootpress/tootpress_toot.png" alt="Toot Symbol" width="35" height="37"/>';
147+
$elephant_img='<img class="tootpress-toot-symbol" src="'.esc_url(plugins_url()).'/tootpress/tootpress_toot.png" alt="Toot Symbol" width="35" height="37"/>';
148+
$elephant_img=tootpress_mastodon_logo_filter_apply($elephant_img);
149+
$elephant_html.=$elephant_img;
148150

149151
if($backlink) {
150152
$elephant_html.='</a>';

tootpress_hooks.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,20 @@ function tootpress_afterloop_filter_apply($current_page_number) {
139139
return $content;
140140
}
141141

142+
/**
143+
* Mastodon Logo Filter
144+
*
145+
* This filter overwrites the Mastodon Logo with Custom Logo
146+
*
147+
* @since 0.5
148+
*
149+
* @param string img HTML Tag (Mastodon Logo)
150+
* @return string img HTML Tag (Custom Logo)
151+
*/
152+
153+
function tootpress_mastodon_logo_filter_apply($img) {
154+
$img=apply_filters( 'tootpress_mastodon_logo_filter', $img );
155+
return $img;
156+
}
157+
142158
?>

0 commit comments

Comments
 (0)