Giter VIP home page Giter VIP logo

Comments (5)

mattyrob avatar mattyrob commented on June 12, 2024 1

I think this may be the function to polyfill and report potential incompatibility.

is_block_theme()

from classicpress-v2.

viktorix avatar viktorix commented on June 12, 2024 1

I did a little digging around. There are two things we need to look at:

  1. Before theme is installed, in the search, WP uses a tag to identify block themes: full-site-editing. This is what's used to filter block themes in the themes page search (js code here).
    • Next step: We need to filter API results to exclude themes tagged with full-site-editing in search results.
  2. As @mattyrob suggested, we need is_block_theme() function (WP code reference).
    • Next step: Instead of polyfill, we should restore the function to its original location to reduce merge conflicts. This is where it should be.
    • Then we can add necessary checks, notice, and prevent block themes from being activated.

Side note: WP core uses themes API v1.2, but it's not documented anywhere. It does seem to work similarly to v1.1.

from classicpress-v2.

viktorix avatar viktorix commented on June 12, 2024

@ElisabettaCarrara thanks for bringing this up.

I agree. We need to deal with block themes.

@xxsimoxx can we use block compatibility feature from #25 to prevent block themes from causing an error?

If we can filter out block themes from theme search, users might accidentally still upload a zip file with block theme. So it would be good if we could prevent errors.

Overall, we should see if it's possible to exclude block themes from theme search in admin.

from classicpress-v2.

xxsimoxx avatar xxsimoxx commented on June 12, 2024

@xxsimoxx can we use block compatibility feature from #25 to prevent block themes from causing an error?

Sure @viktorix .
We have to point out which functions can be "polyfilled".

Maybe also check for full-site-editing tag.

from classicpress-v2.

 avatar commented on June 12, 2024

I have to point out one thing, some block themes do work, the ones having fallback code for the customizer. The completely FSE block themes either have a notice upon activation like Twenty-twentythree that they are broken OR they crash the site without the notice. So we could just exclude the ones that do not have the fallback code to use the customizer? but then again as you say we still do need the polyfills because the block themes can throw errors and even with customizer code they sometimes malfunction.

from classicpress-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.