-
Notifications
You must be signed in to change notification settings - Fork 1
wp_lib_loaded
###Description
This action hook allows your plugin access to WP-Librarian's core plugin class WP_Librarian.
###Context
This hook is called from the hook plugins_loaded which is called very early on, before init. This hook is called on every request.
###Parameters
$wp_librarian
(WP_Librarian) The single instance of WP-Librarian's core plugin class
###Example
If you want your plugin's main class to have WP-Librarian's main class as a property. You could use the following code:
class My_Plugin_Class {
/**
* Single instance of WP-Librarian's core class
* @var WP_Librarian
*/
public $wp_librarian;
public function __construct() {
add_action('wp_lib_loaded', array($this, 'getLibraryClass'));
}
/**
* Sets single instance of WP-Librarian as class property
* @var WP_Librarian $wp_librarian Single instance of WP_Librarian
*/
public function getLibraryClass(WP_Librarian $wp_librarian) {
$this->wp_librarian = $wp_librarian;
}
}
You'd now have access to WP-Librarian's core plugin class for your other hooks. Note that, because this hook is only run at WP's plugins_loaded, you won't have access to the class when the constructor is run. Most hooks should be fine though.
####1. Post Types
Items
Members
Loans
Fines
####2. Taxonomies
Author
Media Type
####3. User Roles
Librarian
Library Admin
####4. Filters
####5. Actions
####6. Releases
6.1 Alpha Releases
Fox Paw
Wolf Tail
Badger Claw
Coyote Snout