Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Shortcodes: [Presentation] shortcode does not work when used outside the main query #8990

Open sixhours opened 6 years ago

sixhours commented 6 years ago

Moving this from Automattic/themes#9

Steps to reproduce the issue

1) Activate the Shoreditch theme. 2) Publish a new page with the Panel Page template. 3) Publish a child page of the Panel Page created in step 2, and add a [presentation] to it. 4) View the Panel Page created in step 2. The presentation does not display. 5) Edit the Panel Page, and add a second [presentation] there. 6) View the Panel Page again. Both presentations will now display.

The plugin appears to look for the presentation shortcode in the main query's content only; Shoreditch uses a new WP_Query to populate a page of children, and the content in this new query is ignored by the presentation plugin.

The same problem happens with the Affinity theme when a [presentation] is added to a page, and then that page is chosen as one of the subpages of the static home page in Customizer -> Theme Options -> Panel 1.

What I expected

The presentation shortcode should display a presentation regardless of the context in which it is shown -- within the main query or within a new WP_Query.

What happened instead

The presentation shows with an error: "This slideshow could not be started. Try refreshing the page or viewing it in another browser."

Adding a second [presentation] to the parent page "fixes" the issue, because the scripts and styles get properly enqueued.

sixhours commented 6 years ago

Details for following up:

stale[bot] commented 6 years ago

This issue has been marked as stale. This happened because:

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.