Replies: 1 comment
-
@JoryHogeveen I have the first few integrations (as handled in the post type supports options) migrated into the new classes at See the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
There are several points within the code where support for Genesis, YARPP, Jetpack, WPML and Polylang (and possibly others according to the
readme.txt
) are "hard-coded" into the logic. This can make it hard to find exactly what support there is, and more importantly, for other plugins / site developers to add their own integrations.Describe the solution you'd like
At all the points where an integration has been made, add an action or filter hook, and make any key values available to callbacks to those hooks.
Then create files for each integration, like
/integrations/genesis.php
, that contain callbacks hooked into the relevant hook, and document them. Have a file likeintegrations.php
which acts like a factory to allow registration of known integrations, and the ability to instantiate the relevant classes and call a common method to apply the hooks.Using hooks in this way aligns with the Open/Closed Principle; It's open to extension (from others), and the original code is closed for modification.
Describe alternatives you've considered
Leaving support for multiple plugins and theme(s) scattered throughout the code-base, with ever-increasing support for others cluttering up the default logic, while not allowing others to easily add their amendments.
Here's a quick and dirty approach as a starting point / example:
View code
Beta Was this translation helpful? Give feedback.
All reactions