Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract and encapsulate WordPress specific function calls #39

Open
JJJ opened this issue Apr 8, 2020 · 1 comment
Open

Abstract and encapsulate WordPress specific function calls #39

JJJ opened this issue Apr 8, 2020 · 1 comment
Labels
type-task Something that needs to be done.

Comments

@JJJ
Copy link
Collaborator

JJJ commented Apr 8, 2020

As WordPress continues to be the primary focus of this project, many of the classes currently use WordPress specific function calls.

One of the longterm goals of this project, is for it to be platform and environment agnostic. For this to happen, anything specific to WordPress needs to be abstracted into some type of middleware.

Without looking, wp_parse_args and sanitize_key() come to mind. There are probably at least a dozen functions being used.

@JJJ JJJ added the type-task Something that needs to be done. label Apr 8, 2020
@alexstandiford
Copy link
Collaborator

alexstandiford commented Apr 13, 2020

I have a plugin boilerplate that abstracts most functionality across key forms plugins. I created an abstract class, Form that is extended by each of the major forms plugins. Gravity_Forms Ninja_Forms, etc.

Each of these extensions implement key abstract methods that are used to handle the fundamental functions that any forms plugin can do. Create forms, delete forms, etc.

The Forms class is accessed using a function that automatically detects which forms plugin should be used, and returns the correct instance.

I wonder if this would be a good strategy to implement for these WordPress specific functions within Berlin, as well? This would provide a clear set of methods that would need to be created in-order for Berlin to support other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-task Something that needs to be done.
Projects
None yet
Development

No branches or pull requests

2 participants