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

Feat/author fields #2102

Merged
merged 4 commits into from
Nov 3, 2022
Merged

Feat/author fields #2102

merged 4 commits into from
Nov 3, 2022

Conversation

adekbadek
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Closes #1723

How to test the changes in this Pull Request:

  1. Set Newspack Blocks to feat/author-blocks-fields branch
  2. Set Newspack Theme to feat/author-custom-fields branch
  3. Ensure you have some regular and Co-Authors Plus (guest) authors on the site
  4. Insert an Authors List block and two Author Profile blocks on a page
  5. Set the list block to display both guest and regular authors
  6. Set the profile blocks to display a regular and a guest author
  7. View the editor and the front-end, verify nothing is broken
  8. Edit the WP author, add some values in the "Additional user profile fields" section
  9. Edit the guest author, add some values in new fields in the "About the guest author" section
  10. Again, view the page in the editor and on the front-end and see that field values are reflected there
  11. View a post by the guest author and one by the WP author, see that the "Job Title" value is displayed in the author bio footer, next to the name

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?

Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

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

It works as expected except from one issue

Editing guest author is fine, but the extra fields for regular users only show up if I'm editing another user other than myself.

To display and save the extra fields when editing your own profile, you must use show_user_profile and personal_options_update hooks.

Also, not sure if this is related to this PR, but the link in the "More by author" in the blocks use the ?author_name=$name format instead of the pretty permalink. Any reason for that? The same link looks fine in the Footer bio when you visit a post.

@adekbadek
Copy link
Member Author

Editing guest author is fine, but the extra fields for regular users only show up if I'm editing another user other than myself.

Thanks for catching that! Fixed in c72631b

the link in the "More by author" in the blocks use the ?author_name=$name format instead of the pretty permalink. Any reason for that?

This is not something this PR touches. It is like that only for guest authors – maybe they are not guaranteed to have a permalink, because there might be name collisions with a WP user.

@leogermani leogermani added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Nov 2, 2022
@adekbadek
Copy link
Member Author

Waiting with the merge for approval on the related Blocks and Theme PRs, because all three should be released as a single feature-set.

@adekbadek adekbadek merged commit 4018af6 into master Nov 3, 2022
@adekbadek adekbadek deleted the feat/author-fields branch November 3, 2022 16:36
matticbot pushed a commit that referenced this pull request Nov 3, 2022
# [1.96.0-alpha.1](v1.95.2...v1.96.0-alpha.1) (2022-11-03)

### Bug Fixes

* allow Stripe Billing portal to render without RAS ([b6e22cd](b6e22cd))
* apply ex-donor status only if user has no active subscriptions ([#2101](#2101)) ([40399ea](40399ea))
* apply My Account template changes only when RAS is active ([cd7b304](cd7b304))
* **stripe:** handle failed invoice fatal error ([#2103](#2103)) ([f865428](f865428))
* use default terms text in reg block if no text defined ([#2078](#2078)) ([443c59c](443c59c))

### Features

* enable setting user custom fields for job title etc. ([#2102](#2102)) ([4018af6](4018af6)), closes [#1723](#1723)
* **newsletter-contact:** disallow overriding membership status field ([#2093](#2093)) ([8b8e134](8b8e134))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.96.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Nov 14, 2022
# [1.96.0](v1.95.4...v1.96.0) (2022-11-14)

### Bug Fixes

* allow Stripe Billing portal to render without RAS ([b6e22cd](b6e22cd))
* apply ex-donor status only if user has no active subscriptions ([#2101](#2101)) ([40399ea](40399ea))
* apply My Account template changes only when RAS is active ([cd7b304](cd7b304))
* package lock ([8707e53](8707e53))
* **stripe:** handle failed invoice fatal error ([#2103](#2103)) ([f865428](f865428))
* **Stripe:** improve handling of invoice error ([#2117](#2117)) ([609bf7d](609bf7d))
* update newspack-scripts to fix CI builds ([#2109](#2109)) ([ec1ee7a](ec1ee7a))
* use default terms text in reg block if no text defined ([#2078](#2078)) ([443c59c](443c59c))

### Features

* enable setting user custom fields for job title etc. ([#2102](#2102)) ([4018af6](4018af6)), closes [#1723](#1723)
* **newsletter-contact:** disallow overriding membership status field ([#2093](#2093)) ([8b8e134](8b8e134))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.96.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
Labels
released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom user profile fields
3 participants