Skip to content

Commit e9d74ff

Browse files
authored
Merge pull request #29 from circuscode/develop
Version 0.5 Echo
2 parents 2aeec61 + b318aa9 commit e9d74ff

13 files changed

+889
-111
lines changed

readme.md

Lines changed: 207 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TootPress copies your toots from Mastodon to WordPress continuously. The toots c
1616

1717
## Installation
1818

19-
1. Download the plugin from the GitHub Repository (see latest Release)
19+
1. Download the plugin from the GitHub Repository (latest Release)
2020
2. Rename the downloaded folder to "tootpress"
2121
2. Upload the folder to the WordPress Plugin Directory
2222
3. Activate the plugin in WordPress
@@ -66,8 +66,8 @@ Following toot objects are not supported.
6666
* Audio
6767
* Video
6868
* Poll
69-
* Emojis
7069
* Teaser
70+
* Quotes
7171

7272
## Excluded Toot Types
7373

@@ -115,9 +115,9 @@ You can use the following code.
115115

116116
### Filter
117117

118-
#### tootpress_preamble_add
118+
#### tootpress_preamble_filter
119119

120-
This filter outputs html content before the toot loop.
120+
This filter outputs html content before the initial toot loop.
121121
You can use the following code.
122122

123123
function tootpress_preamble_add( $preamble ) {
@@ -130,6 +130,176 @@ You can use the following code.
130130
}
131131
add_filter( 'tootpress_preamble_filter', 'tootpress_preamble_add', 10, 1 );
132132

133+
#### tootpress_closing_filter
134+
135+
This filter outputs html content after the last toot loop.
136+
You can use the following code.
137+
138+
function tootpress_closing_add( $content ) {
139+
140+
// Add your filter code here
141+
// Example: $content='<p>Hello World.</p>';
142+
143+
return $content;
144+
145+
}
146+
add_filter( 'tootpress_closing_filter', 'tootpress_closing_add', 10, 1 );
147+
148+
#### tootpress_menu_forward_label
149+
150+
This filter overwrites the forward label in the bottom navigation.
151+
You can use the following code.
152+
153+
function tootpress_menu_forward_label_change( $label ) {
154+
155+
// Add your filter code here
156+
// Example: $label='Newer Posts';
157+
158+
return $label;
159+
160+
}
161+
add_filter( 'tootpress_menu_forward_label', 'tootpress_menu_forward_label_change', 10, 1 );
162+
163+
#### tootpress_menu_backward_label
164+
165+
This filter overwrites the backward label in the bottom navigation.
166+
You can use the following code.
167+
168+
function tootpress_menu_backward_label_change( $label ) {
169+
170+
// Add your filter code here
171+
// Example: $label='Older Posts';
172+
173+
return $label;
174+
175+
}
176+
add_filter( 'tootpress_menu_backward_label', 'tootpress_menu_backward_label_change', 10, 1 );
177+
178+
#### tootpress_beforeloop_filter
179+
180+
This filter outputs content before the toot loop (on all tootpress pages).
181+
You can use the following code.
182+
183+
function tootpress_beforeloop_add( $content, $current_page_number, $last_page_number ) {
184+
185+
// Add your filter code here
186+
// Example: $content='<p>Page '.$current_page_number.' of '.$last_page_number.'</p>';
187+
188+
return $content;
189+
190+
}
191+
add_filter( 'tootpress_beforeloop_filter', 'tootpress_beforeloop_add', 10, 3 );
192+
193+
#### tootpress_afterloop_filter
194+
195+
This filter outputs content after the toot loop (on all tootpress pages).
196+
You can use the following code.
197+
198+
function tootpress_afterloop_add( $content, $current_page_number, $last_page_number ) {
199+
200+
// Add your filter code here
201+
// Example: $content='<p>Page '.$current_page_number.' of '.$last_page_number.'</p>';
202+
203+
return $content;
204+
205+
}
206+
add_filter( 'tootpress_afterloop_filter', 'tootpress_afterloop_add', 10, 3 );
207+
208+
#### tootpress_mastodon_logo_filter
209+
210+
This filter overwrites the Mastodon Logo with Custom Logo.
211+
You can use the following code.
212+
213+
function tootpress_mastodon_logo_change ( $img ) {
214+
215+
// Standard Value
216+
// <img class="toot-symbol" src="FILE-URL" alt="Toot Symbol" width="35" height="37"/>
217+
218+
// Add your filter code here
219+
// Example: $img='<img class="toot-symbol" src="FILE-URL" alt="Custom Toot Symbol" width="32" height="32"/>';
220+
221+
return $img;
222+
223+
}
224+
add_filter( 'tootpress_mastodon_logo_filter', 'tootpress_mastodon_logo_change', 10, 1 );
225+
226+
#### tootpress_between_filter
227+
228+
This filter adds custom HTML between the toots.
229+
You can use the following code.
230+
231+
function tootpress_create_element_between ( $content ) {
232+
233+
// Add your filter code here
234+
// $content='<hr/>';
235+
236+
return $content;
237+
238+
}
239+
add_filter( 'tootpress_between_filter', 'tootpress_create_element_between', 10, 1 );
240+
241+
#### tootpress_toot_content_filter
242+
243+
This filter can be used to manipulate the toot content.
244+
You can use the following code.
245+
246+
function tootpress_manipulate_content ( $content ) {
247+
248+
// Add your filter code here
249+
// $content=str_replace('href=','target="_blank" href=',$content);
250+
251+
return $content;
252+
253+
}
254+
add_filter( 'tootpress_toot_content_filter', 'tootpress_manipulate_content', 10, 1 );
255+
256+
#### tootpress_date_filter
257+
258+
This filter overwrites the date output with custom format.
259+
You can use the following code.
260+
261+
function tootpress_date_custom_format ( $date, $year, $month, $day, $hour, $minute, $second ) {
262+
263+
// $date = 2023-05-30 22:40:28
264+
// $year = 2023
265+
// $month = 05
266+
// $day = 30
267+
// $hour = 22
268+
// $minute = 40
269+
// $second = 28
270+
271+
// Add your filter code here
272+
// $date=$day.'.'.$month.'.'.$year.' '.$hour.':'.$minute.':'.$second;
273+
274+
return $date;
275+
276+
}
277+
add_filter( 'tootpress_date_filter', 'tootpress_date_custom_format', 10, 7 );
278+
279+
#### tootpress_image_filter
280+
281+
This filter can be used to manipulate image tags.
282+
You can use the following code.
283+
284+
function tootpress_image_manipulate ($img_tag,$filename,$description,$width,$height,$image_directory_path,$amount_of_images,$image_number) {
285+
286+
// Amount of Images
287+
// ----------------
288+
// 1 = Single Image
289+
// >1 = Gallery + Size of Gallery
290+
291+
// Image Number
292+
// ------------
293+
// This number indicates position within the gallery
294+
295+
// Add your filter code here
296+
// $img_tag=str_replace('alt=','class="tootpress-image" alt=',$img_tag);
297+
298+
return $img_tag;
299+
300+
}
301+
add_filter( 'tootpress_image_filter', 'tootpress_image_manipulate', 1, 8 );
302+
133303
## WordPress Framework
134304

135305
Following components of WordPress are used in TootPress.
@@ -169,6 +339,22 @@ Backlinks to Mastodon can be activated in the plugin settings. In this case, the
169339

170340
No. TootPress does not support the WordPress Multisite Feature. The plugin is working on the master-site, but is not working on all other child sites within the wordpress network.
171341

342+
### Are the toots included in the WordPress Search?
343+
344+
Unfortunately not.
345+
346+
### Is there any possiblity to modify the outputs on the user interface?
347+
348+
Almost every content element, which is created by TootPress in the FrontEnd, can be modified. For example, you can replace the Mastodon Logo with another image. Enabeling this, the plugin is providing a bunch of filters. Please read the documentation of the filter above.
349+
350+
### Does TootPress recognize, if a published Toot was edited on Mastodon?
351+
352+
The plugin does not sync the Toots between Mastodon and WordPress. TootPress is copying the toots just once after they are published on Mastodon. So if a published toot is edited on Mastodon later, TootPress does not recognized this change anymore, if the toot was already copied to WordPress. Reflecting the edit in WordPress there is only the possibility to make the same edit again directly in the WordPress database. The toots are stored in the table tootpress_toots.
353+
354+
### Can toots be loaded from several Mastodon instances?
355+
356+
No. The plugin does currently not support several Mastodon instances. The architecture is designed to load toots from one single instance. Independent from this, if your toot history is spread over several instances and the timelines does not overlap, you can try to load the timelines one after another. This is not officially supported or tested, but based on user feedback this seems to work surprisingly.
357+
172358
## Maturity Grade
173359

174360
* Low maturity level
@@ -207,6 +393,23 @@ This project is licensed under the GPL3 License.
207393

208394
## Changelog
209395

396+
### 0.5 "Echo"
397+
398+
* July 2025
399+
* Feature: Closing Filter
400+
* Feature: Move Forward Label Filter
401+
* Feature: Move Backward Label Filter
402+
* Feature: Before Loop Filter
403+
* Feature: After Loop Filter
404+
* Feature: Mastodon Logo Filter
405+
* Feature: Between Filter
406+
* Feature: Toot Content Filter
407+
* Feature: Date Filter
408+
* Feature: Image Filter
409+
* Changed: DOM Structure
410+
* Renamed: CSS Classes
411+
* Security: Better Output Escaping
412+
210413
### 0.4 "Cassie Lang"
211414

212415
* June 2024

0 commit comments

Comments
 (0)