Skip to content

Commit

Permalink
Introduce 'shortnotes_bypass_post_status_modification' filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilsoncc committed Nov 26, 2024
1 parent 4acda39 commit 3751557
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/share-on-mastodon.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@ function get_reply_to_id( string $url ): int {
* @return string The modified status text.
*/
function filter_status_text( string $status, \WP_Post $post ): string {
/**
* Filter to bypass modification of default sharing text.
*
* Allows developers to bypass the filtering of a post's status for certain
* post types or other post properties.
*
* @param bool $bypass Whether to bypass the modifying text. Default false.
* @param string $status The default status.
* @param \WP_Post $post The post being shared.
*/
$bypass = apply_filters( 'shortnotes_bypass_post_status_modification', false, $status, $post );

if ( $bypass === true ) {
return $status;
}

$status = Note\transform_content( $post->post_content );

return $status;
Expand Down

0 comments on commit 3751557

Please sign in to comment.