-
Notifications
You must be signed in to change notification settings - Fork 9
mastodon_api_submit_post_data
github-actions[bot] edited this page May 15, 2026
·
1 revision
Allow modifying the post data before it gets inserted or updated.
add_filter(
'mastodon_api_submit_post_data',
function (
array $post_data,
string $status_text,
int|string $in_reply_to_id = null,
array $media_ids,
string $post_format,
string $visibility,
string $scheduled_at = null,
int $post_id = null,
Enable_Mastodon_Apps\Mastodon_App $app
) {
// Your code here
return $post_data;
},
10,
9
);-
array$post_dataThe post data for wp_insert_post() or wp_update_post(). -
string$status_textThe user submitted status text after filtering. -
int|string|null$in_reply_to_idThe ID of the status to reply to. -
array$media_idsThe media attachment IDs. -
string$post_formatThe post format to create. -
string$visibilityThe requested status visibility. -
string|null$scheduled_atThe scheduled post date. -
int|null$post_idThe post ID when updating. -
Enable_Mastodon_Apps\Mastodon_App$appThe app creating or updating the post.
array The potentially modified post data.
apply_filters( 'mastodon_api_submit_post_data', $post_data, $status_text, $in_reply_to_id, $media_ids, $post_format, $visibility, $scheduled_at, $post_id, $app )