carlomanf / wp-funnel-manager

Organises wordpress content into multi-step funnels.
https://wordpress.org/plugins/wp-funnel-manager/
5 stars 0 forks source link

Consider borrowing core pagination features #15

Open carlomanf opened 3 years ago

carlomanf commented 3 years ago

An annoyance with the implementation of funnel interiors is the way the post types often show up in many unwanted places, due to the post types being declared "public."

Ideally, funnel interiors should be hidden from being accessed directly, and only accessible through the exterior. There may be a better way to implement them, by declaring the post types as non-public but rendering them through the pagination feature on the funnel exterior.

If this approach is viable, it will be a good idea to include it in v1.3.0.

This could possibly have other added benefits, such as the use of the pagination blocks that are coming with core version 5.8. It will probably require another extension to the funnel type class, but this also represents an opportunity to re-structure the code to improve the way the legacy funnel type is defined. I would like to switch the classes around to have the legacy funnel type as the superclass and the FSE-capable funnel type as the subclass, because it will make it easier to add new features like this one without needing to modify the legacy class every time.

carlomanf commented 3 years ago

this also represents an opportunity to re-structure the code to improve the way the legacy funnel type is defined. I would like to switch the classes around to have the legacy funnel type as the superclass and the FSE-capable funnel type as the subclass, because it will make it easier to add new features like this one without needing to modify the legacy class every time.

6cf07cd and b8a85c3 (commit message is wrong) implement this, but I'm deciding to remove this issue from the v1.3.0 milestone because the pagination blocks in core version 5.8 will not be sufficient to support this feature. Hopefully a later version of core will provide pagination blocks that are sufficient for this feature. See WordPress/gutenberg#33357 for details.

carlomanf commented 1 year ago

Solving #9 and #10 was flagged as an opportunity for #18, but it might be wise to bring them forward to be solved as part of this feature. The implementation of #11 may have made a wrong turn in allowing the registration of entire funnel types, which in hindsight is a confusing feature, rather than simply enabling full site editing at the funnel level.

The plan here is to add two new post types with the suggested names wpfunnel_head and wpfunnel_step, where wpfunnel_head handles the template for the whole funnel and wpfunnel_step manages the paginable steps. This should solve #9 and #10 as well as simplify the experience for users.

Later on, a wpfunnel_tail post type can be added as part of #18. The other post types currently registered by the plugin will not be used and should be considered legacy as of v1.4.0.