PHPVibe do_action hook

5 Sep 2014
@PHPVibe
15492

The PHPVibe do_action() hook is inspired by the hook with same name used by WordPress.

It allow you to place actions than run on typical requests just as on WordPress.

 

Common actions in PHPVibe are:

//Common actions
function the_header(){
do_action('vibe_header');
}
function the_footer() {
do_action('vibe_footer');
}
function the_sidebar() {
if(is_admin() || (get_option('site-offline', 0) == 0 )) {
do_action('vibe_sidebar');
}
}
function right_sidebar() {
do_action('right_sidebar');
}

All located into the file lib/functions.php

You can hook a function to an action hook using add_action().

Usage:

do_action( $tag, $arg );

Parameters
$tag
(string) (required) The name of the hook you wish to execute.
Default: None
$arg
(mixed) (optional) The list of arguments to send to this hook.
Default: Empty string

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *