Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
465 stars 67 forks source link

Feature Request: shortcode for content excluding image captions #637

Open bocops opened 5 months ago

bocops commented 5 months ago

What

There should be shortcodes for the whole text content and excerpt of a WP post excluding the captions of any images inserted into that post. This could be done either by changing the behaviour of the ap_content and ap_excerpt shortcodes - or, if this change is considered controversial, by adding new shortcodes ap_content_no_captions and ap_excerpt_no_captions.

Why

The shortcode ap_content currently contains the whole post text, including image captions which are included at the location of the image. In the resulting AP post, for example as viewed via Mastodon, the image appears below the text content of the post, while the image caption stays at the current location, where it will break the surrounding prose more often than not.

The only workaround I could come up with is to move images to the bottom of the post, or not use image captions at all for inline images. Both are very restrictive.

If the shortcode did not include image captions, the layout of WP posts would not matter for the resulting AP output.

How

No response

pfefferle commented 3 months ago

I filed this issue on the Mastodon repo: https://github.com/mastodon/mastodon/issues/29747