WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 6 months ago

#1678 closed defect (wontfix)

allow AJAX in theme preview

Reported by: progmastery Owned by:
Milestone: Priority: normal
Component: Theme Directory Keywords: needs-patch ux-feedback needs-testing
Cc:

Description

AJAX does not work in themes in theme preview https://wp-themes.com/ website.

I do not know why it is disabled, maybe for security reasons. But this makes many themes look broken.
Please allow AJAX requests.

Change History (3)

#1 @dd32
2 years ago

Hi and welcome to Trac!

Can you provide a link to an affected theme so we can see what can be done?

Ajax requests are not blocked as far as I'm aware, but due to how the previewer is built, it's entirely possible that it doesn't operate as expected.

#2 @progmastery
2 years ago

https://wp-themes.com/sauron/

  1. AJAX search in menu bar.
  2. AJAX pagination, "next" button after first six posts.

https://wp-themes.com/portfolio-gallery/

  1. AJAX lightbox, 'zoom icon' on boat thumb.

https://wp-themes.com/business-elite/

  1. AJAX pagination, right circled arrow next to first three posts.

#3 @dd32
6 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

The reason for why this doesn't work as expected is that the previewed theme isn't used for wp-admin. For security purposes, I don't think I'm comfortable changing that at present.

It looks like the REST API works, so themes would probably be better using that regardless.

Due to the small number of themes this probably breaks, and the fact that the previewer breaks themes in all sorts of ways, I'm marking this as a wontfix, although with the caveat that hopefully one day with a previewer rewrite we'll get a real preview environment for it.

Note: See TracTickets for help on using tickets.