Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

register_plugin()

Description

Registers a specified plugin by including its hooks and API bindings.

This function attempts to load hook files specific to the current page, as well as an 'all' hook that is
applicable across all pages. Additionally, it loads any API bindings that the plugin may have.

Parameters

ColumnTypeDefaultDescription
$plugin string The short name of the plugin to register.

Return

bool Always returns true after attempting to include the relevant files.

Location

include/plugin_functions.php lines 1612 to 1633

Definition

 
function register_plugin($plugin)
    {
    global 
$plugins,$language,$pagename,$lang,$applicationname;

    
# Also include plugin hook file for this page.
    
if ($pagename=="collections_frameless_loader"){$pagename="collections";}

    
$pluginpath=get_plugin_path($plugin);

    
$hookpath=$pluginpath "/hooks/" $pagename ".php";
    if (
file_exists($hookpath)) {include_once $hookpath;}

    
# Support an 'all' hook
    
$hookpath=$pluginpath "/hooks/all.php";
    if (
file_exists($hookpath)) {include_once $hookpath;}

    
# Support standard location for API bindings
    
$api_bindings_path=$pluginpath "/api/api_bindings.php";
    if (
file_exists($api_bindings_path)) {include_once $api_bindings_path;}

    return 
true;
    }

This article was last updated 17th November 2024 15:05 Europe/London time based on the source file dated 8th November 2024 11:50 Europe/London time.