wp_lib_dash_api - roberts-sandbox/create-repo GitHub Wiki
###Description
This action hook allows developers to interact with all Dash API calls, requests to retrieve data or modify the library without reloading the Dashboard page. This could, for example, be used to add a special permissions check to all API requests. I would recommend using the more specific hook wp_lib_dash_api_ for modifying/adding specific Dash API requests.
###Context
To access the Library Dashboard users must be at the minimum a librarian and thus logged in as a WordPress user. No nonce validation has yet happened as nonces are specific to the Dash page they came from.
###Parameters
$ajax_api
The instance of WP-Librarian's Dashboard API class. Access to this is necessary to handle completing the AJAX request properly.
$api_request
The name of the API request desired to be completed by the Dashboard. When scanning an item's barcode the $api_request is 'scan-barcode'.
###Example
I'll be adding one some time soon. Check out the examples for the related hooks to get an idea how you might use this hook.
###See Also
wp_lib_dash_api_ wp_lib_dash_action wp_lib_dash_action_ wp_lib_dash_page wp_lib_dash_page_