Filters - roberts-sandbox/create-repo GitHub Wiki

Filters are a core part of WordPress development that allow plugins to hook onto flows of data, modifying them.

WP-Librarian contains a very limited range of filters as they only started being added around Spring 2015. Filters are slowly being added to appropriate places but please feel free to pester me via email if you want some filters added to particular parts of the plugin.

The two other reasons slowing addition of filters are:

  • Adding new filters requires writing up a whole documentation page. I have little free time between uni work as it is to work on coding WP-Librarian so adding/documenting filters eats into that time.
  • WP-Librarian is still in Alpha release, so many parts of it are subject to great change. I don't want to waste my time adding and documenting a filter only to then depreciate it a few months later.

###Dashboard Filters

These filters modify data pertaining to AJAX requests from the Library Dashboard.

wp_lib_dash_home_buttons
Allows developers to modify the buttons on the Dashboard's homepage. Can be used in conjunction with wp_lib_dash_page_ to add a custom Dash Page with a link to it from the Dash home.

###Settings Filters

Filters that can modify WP-Librarian's settings page and its registered settings

wp_lib_settings_tabs
Allows developers to modify the tabs on plugin's settings page. The plugin's Dev Kit uses this filter to add its custom settings tab.

wp_lib_plugin_settings
Allows developers to modify WP-Librarian's settings. This could involve changing the default values of a setting or adding settings so that the plugin's settings class (which only accepts settings registered with WP-Librarian) can be used.

###Error Filters

wp_lib_error_codes
Allows developers to modify WP-Librarian's error codes. This could be used to add custom error codes so that wp_lib_error() can be called from within your plugin, among other benefits.

###Deletion Filters

wp_lib_bypass_deletion_checks
Allows developers to skip WP-Librarian's integrity checks for certain posts.

⚠️ **GitHub.com Fallback** ⚠️