Repository navigation
Show event and venue details in post embeds - #2653
faisalahammad wants to merge 1 commit into
Conversation
- Add Embed class that prints event or venue details in post embeds. - Event embed shows date, venue, online, past or canceled state and an RSVP link. - Venue embed shows address, phone and website. - Load a small embed stylesheet only for events and venues. - Add unit tests and a changelog entry. Fixes GatherPress#2038
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Preview changes with PlaygroundCustomize PR PlaygroundTo customize the Playground preview for this specific PR, create a file at:
The override is merged into the generated blueprint and can be used to:
Example: {
"$schema": "https://gatherpress.org/playground-preview/pr-override-schema.json",
"landingPage": "/wp-admin/edit.php?post_type=gatherpress_venue",
"siteOptions": {
"show_on_front": "page"
},
"features": {
"networking": true
},
"prependSteps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"slug": "simple-location"
},
"options": {
"activate": true
}
}
],
"appendSteps": [
{
"step": "runPHP",
"code": ""
}
]
}Go to Playground PR preview customization for more details. You can preview the recent changes for PR#2653 with the following PHP versions: PHP Version 8.4PHP Version 8.2PHP Version 8.1Download Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions. |
Test Coverage Report✅ All coverage checks passed! ✅ PHP Coverage✅ JavaScript CoverageThis comment is automatically updated on each push. |
wppoland
left a comment
There was a problem hiding this comment.
LGTM! Keying Embed::get_details_markup() and Embed::enqueue_style() off post_type_supports() for Event::SUPPORT, Venue::SUPPORT, and Rsvp::SUPPORT works nicely for both default and custom post types. Using get_public_venue_information() and checking post_password_required() ensures cached embed iframes never leak protected or non-public data, and the unit test coverage in Test_Embed is thorough.
Fixes #2038
Proposed changes:
Embedclass hooksembed_contentand adds the details that matter.target="_top"). The RSVP link only shows for upcoming events whose post type declaresgatherpress-rsvp.wp-embed.jsignores clicks on links to another host.post_type_supports()(gatherpress-event-dateandgatherpress-venue-information), so custom event and venue post types get the same embed.Event::get_public_venue_information(), so a password-protected venue does not leak its address. A password-protected event shows no details at all, same as core hides its excerpt.build/embed_style.css) loads onenqueue_embed_scripts, only when the embedded post is an event or venue.Other information:
AI assistance
Testing instructions:
Expected: under the excerpt you see "Date:", "Venue:" with the address, and an "RSVP" link. Clicking RSVP opens the event in the full window.
embed_style.cssin the iframe source.Credit (for release notes)
My WordPress.org username: faisal03
Changelog entry
Changelog entry added manually in
.github/changelog/2038-event-venue-embeds.