Creating addons for plugins

The process of creating addons is similar to the process we used for plugins. However, the possibility of creating an addon depends on the quality of the code in the core plugin. The core plugin should either provide an API to build addons or necessary hooks for extension. As many plugins don't contain a separate API, most addons are built by using the existing hooks. Let's see how we can create an addon for the post attachments plugin created in the previous chapter. Assume that we have the following requirements to be developed as an addon:

  • Restrict attachment file types based on default WordPress user roles. Let's provide PDF file access only for non-subscriber members and all other file types to all users ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.