Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: if a post has a custom excerpt, use it #880

Merged
merged 1 commit into from
Sep 28, 2021
Merged

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Sep 28, 2021

All Submissions:

Changes proposed in this Pull Request:

#874 added functionality to ensure that generated excerpts adhere to the length attribute set in Homepage Posts blocks. However, it seems that it causes every post to show a generated excerpt, even if it has a custom excerpt. This fix checks for a custom excerpt and uses it if it exists, before generating one.

How to test the changes in this Pull Request:

  1. Publish a post with a lengthy custom excerpt and some different post content.
  2. On master, add a Homepage Posts block that will show this post to a page and enable "Show Excerpt."
  3. Observe that your post is shown with a generated excerpt, not with your custom one, in both the editor and on the front-end.
  4. Switch to this branch, confirm that the editor and front-end now show your custom excerpt, but trimmed according to the Excerpt Length setting in block attributes.
  5. Also confirm that posts with no custom excerpt display an excerpt generated from the post content, trimmed according to the Excerpt Length attribute.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo added bug Something isn't working [Status] Needs Review labels Sep 28, 2021
@dkoo dkoo requested a review from a team September 28, 2021 20:05
@dkoo dkoo self-assigned this Sep 28, 2021
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as described! 💯

@dkoo dkoo merged commit 57b5cdd into master Sep 28, 2021
@dkoo dkoo deleted the fix/excerpt-filter branch September 28, 2021 20:55
matticbot pushed a commit that referenced this pull request Sep 28, 2021
# [1.39.0-alpha.2](v1.39.0-alpha.1...v1.39.0-alpha.2) (2021-09-28)

### Bug Fixes

* if a post has a custom excerpt, use it ([#880](#880)) ([57b5cdd](57b5cdd))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.39.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 28, 2021
# [1.39.0](v1.38.0...v1.39.0) (2021-09-28)

### Bug Fixes

* if a post has a custom excerpt, use it ([#880](#880)) ([57b5cdd](57b5cdd))
* limit excerpt lengths even for custom excerpts ([#874](#874)) ([85f5bf4](85f5bf4))

### Features

* **donate:** remove NRH metadata ([080430c](080430c))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.39.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants