drewbaker / wp-easy

Plugin that powers the WP Easy theme
1 stars 1 forks source link

Move templating into a theme, keeping functionality in the plugin #1

Closed drewbaker closed 2 months ago

drewbaker commented 2 months ago

Ideally the plugin is just the functionality and supporting code.

A theme should still contain the templates, components, CSS, JS and route definitions.

rsm0128 commented 2 months ago

@drewbaker Plugin provides default templates and users can override it in theme. As you might know plugins like WooCommerce and PaidMembershipPro provides default templates with the plugin and that's why I implemented in the same way.

drewbaker commented 2 months ago

Oh, OK, good idea!

rsm0128 commented 2 months ago

Please check https://github.com/drewbaker/wp-easy-plugin/blob/main/includes/class-utils.php#L333-L345 As you can see, it checks in below order.

drewbaker commented 2 months ago

So in a theme, you'd have this:

/wp-easy/components/
/wp-easy/templates/
/wp-easy/scripts/
/wp-easy/styles/
/wp-easy/layouts/

I think I'd prefer to not have them inside /wp-easy/.

rsm0128 commented 2 months ago

@drewbaker Currently components and layouts are implemented in the way already. I'll move templates to the subdirectory