Extending plugins with custom actions and filters

In the previous section, we created a separate plugin to explain the extending capabilities with WordPress core actions and filters. In this section, we will be looking at how to use our own custom actions and filters to extend our forum management plugin.

In Chapter 5, Implementing Application Content Restrictions, we implemented content restrictions on individual topics using several visibility types such as Members, Guests, and Everyone. Here, we are going to look at how to extend those features to enable custom restriction types and visibility levels.

Assume that we want to restrict the topic based on a user meta value of the current user. This is a common requirement in web applications ...

Get Wordpress Web Application Development - Third Edition 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.