wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Feature Request: Use `the_excerpt` as is when `[ap_excerpt]` is called without length argument

Open mdingemanse opened this issue 2 years ago • 3 comments

What

Ideally [ap_excerpt] would mirror WP excerpt logic by using the default cutoff for posts that do not have an excerpt set, but outputting the whole the_excerpt if it exists for a post.

If a user does set an explicit length argument it arguably should still be applied.

Why

This would align with how WP themes generally deal with excerpts and excerpting. It is also a sensible default: trust the user who sets an except and align with their expectation that without any length specified, this will show up as is through AP.

(Current behaviour, unexpected for me: the excerpt is used but cutoff at default length. I need to set length explicitly in [ap_excerpt] shortcode call. But I don't know how long my excerpts will be so I end up setting some random high number. Not having to set anything would be a more sensible default.)

How

Basically, for [ap_excerpt] without a length argument specified, check whether a post has an excerpt and if so, display that as is. If not, take first lines of the_content and truncate at default length.

If length is explicitly specified in [ap_excerpt length=340] by the user then apply that to the_content or tothe_excerpt, if that exists.

mdingemanse avatar Dec 10 '23 09:12 mdingemanse

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 09 '24 01:04 github-actions[bot]

No the issue should not be closed, it provides a reasoned proposal that brings the plugin closer to expected behaviour for WP users.

mdingemanse avatar Apr 09 '24 05:04 mdingemanse

keep

pfefferle avatar Apr 18 '24 06:04 pfefferle

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 17 '24 01:08 github-actions[bot]