WordPress hooks of Advanced Views
Advanced Views includes a set of WordPress hooks, allowing you to customize the plugin behavior from your theme (or code snippets).
1. Generic hooks list
advanced_views/manage_capability
advanced_views/twig/custom_functions
advanced_views/twig/custom_filters
2. Generic hook descriptions
Manage capability
By default, Layout and Post Selection management (menu items, lists, etc.) is available only to administrators (or custom roles with the manage_options capability).
To change the default capability use this hook:
add_filter( 'advanced_views/manage_capability', function (string $manage_capability): string {
// Allow management for anyone who can edit posts, e.g. authors.
return "edit_posts";
} );Container
Using this hook, you can define a PHP-DI container, and then use it inside Layout PHP Controlller and Selection PHP Controller classes. Read more
Custom Twig functions
Now you can call your functions in twig templates of your Layouts and Post Selections.
Custom Twig filters
Now you can call your filters in twig templates of your Layouts and Post Selection.
Last updated