-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Where to put my own code? #565
Comments
You can edit your own plugin however you want to and put the code wherever you want. I have a walk through on writing a plugin using the boilerplate here if you wanted to see a simplified usage: https://devinvinson.com/simple-login-style-plugin/ |
Thank you, but my plugin won't be this simple (simple in meaning including some js and/or css). |
@sintacs That depends on how the class is designed. But let's say it's a simple class with methods that should be added to a hook. Then either put it in the admin or public folder depending on what the functionality belongs to. And include it inside a method in class-plugin-name-public.php or even the load_dependencies method in class-plugin-name.php. Now all that's left to do is instantiate the class in the define_admin_hooks or define_public_hooks and hook it in. But really, there are no good or bad ways to do it. This boilerplate is designed as a starting point for creating a plugin. And is not a framework with strict rules on what you should and shouldn't do. That is up to you :) |
@VoHoTv Thank you for your answer. I figured it out. :D |
@DevinVinson Looks like you've got some broken image links on https://devinvinson.com/simple-login-style-plugin/ |
Hello,
I installed the plugin and want to start adding my own code (class exists).
How do I start, where do I put the code?
Greetings
Dirk
The text was updated successfully, but these errors were encountered: