Bigace_HooksThe plugin API is located in this file, which allows for creating actions and filters and hooking functions, and methods. The functions or methods will then be run when the action or filter is called.
The API callback examples reference functions, but can be methods of classes. To hook methods, you'll need to pass an array one of two ways.
Any of the syntaxes explained in the PHP documentation for the 'callback' type are valid.
Also see the Plugin API for more information and examples on how to use a lot of these functions.
A list of existing hooks can be found here:
apply_filter('admin_menu', $menu); The Admin navigation structure is given in $menu, so you can customize the menu to your needs (most often you will add items).
apply_filters('edit_item_meta', array(), $item) Called before the Item Attribute screen is rendered (currently only for pages). If you want to add further input fields from your plugin, add a key/value pair entry to the first argument array. Each pair is one collapsable admin box, with "key" = box title and "value" = box content.
apply_filters('credits', $allCredits) If you want to add an entry to the credits screen, use this filter.
apply_filters('admin_portlets', $portlets, $menu, $controller) If you want to add a portlet to a portlet enabled admin screen, use this filter. The first argument is an array with all portlets instances, the second one is the name of the admin menu displaying the portlets and the last one the controller itself.
apply_filters('get_pagetypes', $pagetypes) An array of lowercased names for all available pagetypes. Pagetype names are controller names in the sense of the Zend Framework. The 'redirect' pagetypes for example points to the Bigace_RedirectController.
apply_filters('metatags', $values, $item); Send from the {metatags} Smarty TAG and Zend_View_Helper, default tags like description, author, robots. Strictly for <meta> TAGs. Only operate with the given array.
apply_filters('metatags_more', array(), $item); Send from the {metatags} Smarty TAG and Zend_View_Helper, for any additional HTML TAG in the pages <header>. Add any HTML string to the array you want.
apply_filters('create_item_meta', array(), _BIGACE_ITEM_MENU) Send from the "Create Page" dialog. See "edit_item_meta" for more infos.
apply_filters('dialog_setting_images', $vars, $id) Returns an array with the values for the image inserting/linking dialog.
apply_filters('dialog_setting_links', $vars, $id) Returns an array with the values for the cms link/url inserting dialog.
#############################################################################
do_action('update_item', $itemtype, $id, $langid, $val, $timestamp) Called when updating any Item. $val is the array with all submitted item properties. Fetch your required values from $_POST.
do_action('create_item', $this->getItemtypeID(), $id, $langid) Called when an Item was created.
do_action('page_header', $MENU) Send from the Smarty and Menu command, right before the pages layout is displayed. Register to send additional header() for example.
do_action('uninstall_community', Bigace_Community $community) Send when a community is uninstalled.
do_action('tpl_header', $MENU) inside the html head of your template do_action('tpl_footer', $MENU) in a templates footer do_action('admin_header') do_action('admin_footer') do_action('admin_html_head') do_action('application_header', $MENU) do_action('delete-item', $itemtypeID, $id, $langid) // $langid is optional
Located in /Hooks.php (line 113)
static void
add_action
(string $tag, callback $functionToAdd, [int $priority = 10], [int $acceptedArgs = 1])
static boolean
add_filter
(string $tag, callback $functionToAdd, [int $priority = 10], [int $acceptedArgs = 1])
static boolean
remove_action
(string $tag, callback $functionToRemove, [int $priority = 10], [int $acceptedArgs = 1])
static boolean
remove_filter
(string $tag, callback $functionToRemove, [int $priority = 10], [int $acceptedArgs = 1])
static add_action (line 335)
Hooks a function on to a specific action.
Actions are the hooks that the BIGACE core launches at specific points during execution, or when specific events occur. Plugins can specify that one or more of its PHP functions are executed at these points, using the Action API.
The $priority is used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
static add_filter (line 162)
Hooks a function or method to a specific filter action.
Filters are the hooks that BIGACE launches to modify text of various types before adding it to the database or sending it to the browser screen. Plugins can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.
To use the API, the following code should be used to bind a callback to the filter
Hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. The <tt>$acceptedArgs allow for calling functions only when the number of args match. Hooked functions can take extra arguments that are set when the matching <tt>do_action()</tt> or <tt>apply_filters()</tt> call is run. For example, the action <tt>comment_id_not_found</tt> will pass any functions that hook onto it the ID of the requested comment.
<strong>Note:</strong> the function will return true no matter if the function was hooked fails or not. There are no checks for whether the function exists beforehand and no checks to whether the <tt>$functionToAdd is even a string. It is up to you to take care and this is done for optimization purposes, so everything is as quick as possible.
Thr $priority is used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
static apply_filters (line 193)
Call the functions added to a filter hook.
The callback functions attached to filter hook <tt>$tag</tt> are invoked by calling this function. This function can be used to create a new filter hook by simply calling this function with the name of the new hook specified using the <tt>$tag</a> parameter.
The function allows for additional arguments to be added and passed to hooks.
static current_filter (line 412)
Return the name of the current filter or action.
static did_action (line 462)
Return the number times an action is fired.
static do_action (line 356)
Execute functions hooked on a specific action hook.
This function invokes all functions attached to action hook <tt>$tag</tt>. It is possible to create new action hooks by simply calling this function, specifying the name of the new hook using the <tt>$tag</tt> parameter.
You can pass extra arguments to the hooks, much like you can with apply_filters().
static has_action (line 451)
Check if any action has been registered for a hook.
static has_filter (line 424)
Check if any filter has been registered for a hook.
static remove_action (line 484)
Removes a function from a specified action hook.
This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute.
static remove_filter (line 506)
Removes a function from a specified filter hook.
This function removes a function attached to a specified filter hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute.
To remove a hook, the <tt>$functionToRemove</tt> and <tt>$priority</tt> arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.
Documentation generated on Tue, 22 Feb 2011 12:01:37 +0100 by phpDocumentor 1.4.3