
Toots in the Blog
TootPress copies your toots from Mastodon to WordPress continuously. The toots can be displayed chronologically in the blog, making your timeline accessible to other people outside of Mastodon. In addition, you regain ownership of your own data back.
Following toot objects are supported.
Following toot objects are not supported.
Following toot types are excluded from the data transfer.
Data storage and process logic is separated from the WordPress Framework. The toots are not saved in the table wp_posts. And TootPress is not registering a custom post type for the toots as well.
TootPress comes with basic CSS Styles. For best fit it is required to add additional styles in your theme. All TootPress UI elements can be addressed with individual CSS selectors. Please use the browser development tools to find the right classes.
TootPress creates 2 folders within the WordPress Uploads Directory.
Action: tootpress_toots_update
It will be fired after toot update to execute custom post-processing.
You can use the following code.
function tootpress_toots_update_postprocessing() {
// Add your code to be executed here
}
add_action('tootpress_toots_update', 'tootpress_toots_update_postprocessing');
Filter: tootpress_preamble_filter
It outputs html content before the toot loop.
You can use the following code.
function tootpress_preamble_add( $preamble ) {
// Add your filter code here
// Example: $preamble='Hello World.
';
return $preamble;
}
add_filter( 'tootpress_preamble_filter', 'tootpress_preamble_add', 10, 1 );
Filter: tootpress_closing_filter
It outputs html content after the last toot loop.
You can use the following code.
function tootpress_closing_add( $content ) {
// Add your filter code here
// Example: $content='Hello World.
';
return $content;
}
add_filter( 'tootpress_closing_filter', 'tootpress_closing_add', 10, 1 );
Filter: tootpress_menu_forward_label
This filter overwrites the forward label in the bottom navigation.
You can use the following code.
function tootpress_menu_forward_label_change( $label ) {
// Add your filter code here
// Example: $label='Newer Posts';
return $label;
}
add_filter( 'tootpress_menu_forward_label', 'tootpress_menu_forward_label_change', 10, 1 );
Filter: tootpress_menu_backward_label
This filter overwrites the backward label in the bottom navigation.
You can use the following code.
function tootpress_menu_backward_label_change( $label ) {
// Add your filter code here
// Example: $label='Older Posts';
return $label;
}
add_filter( 'tootpress_menu_backward_label', 'tootpress_menu_backward_label_change', 10, 1 );
Filter: tootpress_beforeloop_filter
This filter outputs content before the toot loop (on all tootpress pages).
You can use the following code.
function tootpress_beforeloop_filter_add( $content, $page_number ) {
// Add your filter code here
// Example: $content='Page '.$page_number.'
';
return $label;
}
add_filter( 'tootpress_beforeloop_filter', 'tootpress_beforeloop_filter_add', 10, 2 );
Filter: tootpress_afterloop_filter
This filter outputs content after the toot loop (on all tootpress pages).
You can use the following code.
function tootpress_afterloop_add( $content, $current_page_number, $last_page_number ) {
// Add your filter code here
// Example: $content='Page '.$current_page_number.' of '.$last_page_number.'
';
return $content;
}
add_filter( 'tootpress_afterloop_filter', 'tootpress_afterloop_add', 10, 3 );
Filter: tootpress_mastodon_logo_filter
This filter overwrites the Mastodon Logo with Custom Logo.
You can use the following code.
function tootpress_mastodon_logo_change ( $img ) {
// Standard Value
//
// Add your filter code here
// Example: $img='
';
return $img;
}
add_filter( 'tootpress_mastodon_logo_filter', 'tootpress_mastodon_logo_change', 10, 1 );
Filter: tootpress_between_filter
This filter adds custom HTML between the toots.
You can use the following code.
function tootpress_create_element_between ( $content ) {
// Add your filter code here
// $content='
';
return $content;
}
add_filter( 'tootpress_between_filter', 'tootpress_create_element_between', 10, 1 );
Filter: tootpress_toot_content_filter
This filter can be used to manipulate the toot content.
You can use the following code.
function tootpress_manipulate_content ( $content ) {
// Add your filter code here
// $content=str_replace('href=','target="_blank" href=',$content);
return $content;
}
add_filter( 'tootpress_toot_content_filter', 'tootpress_manipulate_content', 10, 1 );
Filter: tootpress_date_filter
This filter overwrites the date output with custom format.
You can use the following code.
function tootpress_date_custom_format ( $date, $year, $month, $day, $hour, $minute, $second ) {
// $date = 2023-05-30 22:40:28
// $year = 2023
// $month = 05
// $day = 30
// $hour = 22
// $minute = 40
// $second = 28
// Add your filter code here
// $date=$day.'.'.$month.'.'.$year.' '.$hour.':'.$minute.':'.$second;
return $date;
}
add_filter( 'tootpress_date_filter', 'tootpress_date_custom_format', 10, 7 );
Filter: tootpress_image_filter
This filter can be used to manipulate image tags.
You can use the following code.
function tootpress_image_manipulate ($img_tag,$filename,$description,$width,$height,$image_directory_path,$amount_of_images,$image_number) {
// Amount of Images
// ----------------
// 1 = Single Image
// >1 = Gallery + Size of Gallery
// Image Number
// ------------
// This number indicates position within the gallery
// Add your filter code here
// $img_tag=str_replace('alt=','class="tootpress-image" alt=',$img_tag);
return $img_tag;
}
add_filter( 'tootpress_image_filter', 'tootpress_image_manipulate', 1, 8 );