add doc of best practices for writing plugins
See original GitHub issueI think this would probably be useful, keeping track of some best practices:
- Always write plugins as a function that takes an
options
object, for future-proofing. - When accepting defaultBlock/Mark/etc. arguments, use the
Node.create()
andNode.createProperties()
static methods for standardizing these, just like core does. - When allowing customization of what changes will actually be applied to the document, use a change function with signature
(change, ...args)
like core does.
If anyone thinks of others, feel free to add them here so we don’t forget!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Best Practices | Plugin Developer Handbook
Here are some best practices to help organize your code so it works well alongside WordPress core and other WordPress plugins.
Read more >Best Practices for Plugin Development — Omeka 2.7 ...
Best Practices for Plugin Development¶ · Method Naming Conventions¶ · Maintain expected behaviors in Omeka¶ · Database changes¶ · Record API¶ · Use...
Read more >Documentation Best Practices: Guide To Make It Effective
Check this blog to learn documentation best practices that you need to know before creating knowledge base for your company.
Read more >Best practices for writing extensions - CKAN documentation
Try to limit your extension to interacting with CKAN only through CKAN's plugin interfaces and plugins toolkit. It's a good idea to keep...
Read more >Tutorial: Write and register a plug-in - Microsoft Learn
Edit the class file to enable a plug-in. Add the following using statements to the top of the FollowupPlugin.cs file: C#
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oyeanuj Ah yes agreed! Actually I realized that I want to change up how those work by creating a separate plugin soon called
slate-only-in
that you can wrap any other plugins with. That way it doesn’t have to be repeated in all plugins code basesAdded to the Plugins guide!