-
Notifications
You must be signed in to change notification settings - Fork 154
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
Replace support review component with shared one. #408
Replace support review component with shared one. #408
Conversation
I remembered this discussion — it was already like this in the old theme, so this is just fixing that inconsistency. I have no strong preference on which precision is better, but if we want to change it, we can just transfer that linked issue to wporg-mu-plugins and update the
Technically post_id is used in the filter, so it could be used, though it isn't used here. You could just return something truthy from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few little notes.
wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/inc/block-config.php
Outdated
Show resolved
Hide resolved
wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/inc/block-config.php
Show resolved
Hide resolved
wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php
Show resolved
Hide resolved
wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/inc/block-config.php
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One more minor comment about return types, feel free to grab either code suggestion 🙂
wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/inc/block-config.php
Outdated
Show resolved
Hide resolved
See: #408 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14173 74240141-8908-4e6f-9713-ba540dce6ec7
See: #408 Related: r14173 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14174 74240141-8908-4e6f-9713-ba540dce6ec7
See: WordPress#408 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14173 74240141-8908-4e6f-9713-ba540dce6ec7
See: WordPress#408 Related: r14173 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14174 74240141-8908-4e6f-9713-ba540dce6ec7
This PR updates the support forum reviews stars & bars to use the shared component.
Related: WordPress/wporg-mu-plugins#633, #380
Important
The forums display more precise rating numbers, while the new components round ratings to the nearest 0.5. Since we already use the new components in multiple places, if we want to keep the current precision, we should do it everywhere at once in the new components.
Considerations
The
ratings-stars
andratings-bars
components expect the context to containpostId
. However, based on how bbPress works and how it's been modified, thepostId
is not set.As a result, I've made use of the
render_block_context
block to set it. we still don't use that inwporg_set_rating_data
, as we need to callwporg_support_get_compat_object
to get all the relevant data. It feels a bit silly, but feels better than the alternative. The alternative would be to change the blocks to not return if the post_id is not set. That feels less predictable.I've also done some minor styling updates.
Screenshots