User Tools

Site Tools


core_docs:plugin_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
core_docs:plugin_functions [2016/06/04 19:49]
Tyblitz [exec_filter]
core_docs:plugin_functions [2018/02/09 08:54]
backit [add_filter] added link to core filters
Line 1: Line 1:
 ====== Plugin functions ====== ====== Plugin functions ======
-This page documents the GetSimpleCMS functions available from ''​admin/​inc/​plugin_functions.php''​.  +This page documents the GetSimpleCMS functions available from ''​admin/​inc/​plugin_functions.php''​.\\ 
-This page is currently ​work in progress.+The ones you will most commonly need as plugin/ theme developer are: 
 +<​code>​register_plugin,​ add_action, add_filter, createSideMenu,​ createNavTab,​ register_script,​ queue_script,​ register_style,​ queue_style</​code>​
  
 +The following functions are mostly used by GS internally:
 +<​code>​get_scripts_frontend,​ get_scripts_backend,​ get_styles_frontend,​ get_styles_backend,​ read_pluginsxml,​ create_pluginsxml,​ cdn_fallback,​ change_plugin</​code>​
 ===== add_action ===== ===== add_action =====
 **Signature** **Signature**
Line 25: Line 28:
  
 ===== createSideMenu ===== ===== createSideMenu =====
-''''​+**Signature** 
 +<​code>​createSideMenu($id,​ $txt[, $action=null,​ $always=true])</​code>​ 
 + 
 +**Description**\\ 
 +Adds a sidebar link item to the sidebar with ''​$id'' ​as id. 
  
 **Parameters:​** **Parameters:​**
 +   ​*''​$id'',​ the id of the sidebar to output the link in
 +   ​*''​$txt'',​ the text of the sidebar item
 +   ​*''​$action''​ //​(optional)//,​ the action parameter in the link's query string. Eg, "​edit"​ will generate a link like ''​load.php?​id=myplugin&​action=edit''​
 +   ​*''​$always''​ //​(optional)//,​ set to true if the sidebar item should be loaded on every admin page with a sidebar.
 ===== createNavTab ===== ===== createNavTab =====
 **Signature** **Signature**
Line 63: Line 74:
  
 **Parameters** **Parameters**
-  * ''​$filter_name'',​ the name of the filter to hook into. Use one of the built-in filters, or one defined by a plugin.+  * ''​$filter_name'',​ the name of the filter to hook into. Use one of the [[plugins:​hooks_filters|built-in filters]], or one defined by a plugin.
   * ''​$added_function'',​ the name of a function to execute on ''​$filter_name''​.   * ''​$added_function'',​ the name of a function to execute on ''​$filter_name''​.
 ===== exec_filter ===== ===== exec_filter =====
 **Signature** **Signature**
-<​code>​exec_filter($filter_hook[, $data = array()])</​code>​+<​code>​exec_filter($filter_name[, $data = array()])</​code>​
  
 **Description**\\ **Description**\\
Line 74: Line 85:
  
 **Parameters**\\ **Parameters**\\
-  * ''​$filter_hook'',​ the name of the filter. Other developers can add their filters by calling ''​add_filter($filter_hook, '​their_function'​);''​+  * ''​$filter_name'',​ the name of the filter. Other developers can add their filters by calling ''​add_filter($filter_name, '​their_function'​);''​
   * ''​$data''​ //​(optional)//,​ the data to be passed through the filter (an array of parameters). Defaults to null.   * ''​$data''​ //​(optional)//,​ the data to be passed through the filter (an array of parameters). Defaults to null.
 ===== change_plugin ===== ===== change_plugin =====
core_docs/plugin_functions.txt · Last modified: 2018/02/09 08:56 by backit