Skip to content

Commit ce5095b

Browse files
committed
Afterloop Filter
1 parent b915df9 commit ce5095b

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ This project is licensed under the GPL3 License.
216216

217217
Release pending.
218218

219+
* Added: TootPress Afterloop Filter
219220
* Added: Caching of ActivityPub Endpoints in WP REST API
220221
* Added: Fade out WB REST CACHE Icon @ Admin Bar
221222
* Added: Disable UpdraftPlus @ Admin Bar

unmus.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
require_once('unmus_widgets.php');
4949
require_once('unmus_visibility.php');
5050
require_once('unmus_cache.php');
51+
require_once('unmus_tootpress.php');
5152

5253
// Ensure that all required functions are available during setup
5354
require_once( ABSPATH . 'wp-admin/includes/upgrade.php');

unmus_tootpress.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* TootPress
5+
*
6+
* @package unmus
7+
* @since 0.9
8+
*/
9+
10+
// Security: Stops code execution if WordPress is not loaded
11+
if (!defined('ABSPATH')) { exit; }
12+
13+
/**
14+
* Afterloop Filter
15+
*
16+
* @since 0.9
17+
*
18+
*/
19+
20+
function tootpress_afterloop_add( $content ) {
21+
22+
$domain=get_site_url();
23+
$path='/tweets/';
24+
25+
$content='<div class="tootpress-afterloop-filter"><p>Vor Mastodon war Twitter.<br/><a style="padding-top:7px;" href="'.$domain.$path.'">Tweets lesen</a></p></div>';
26+
27+
return $content;
28+
29+
}
30+
add_filter( 'tootpress_afterloop_filter', 'tootpress_afterloop_add', 99, 1 );
31+
32+
?>

0 commit comments

Comments
 (0)