PHP code example of bainternet / php-hooks

1. Go to this page and download the library: Download bainternet/php-hooks library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bainternet / php-hooks example snippets



global $hooks;
$hooks->add_action('header_action','echo_this_in_header');

function echo_this_in_header(){
   echo 'this came from a hooked function';
}

echo '<div id="extra_header">';
global $hooks;
$hooks->do_action('header_action');
echo '</div>';