Title: hooks do not work
Last modified: September 10, 2020

---

# hooks do not work

 *  Resolved [Ewald Harmsen](https://wordpress.org/support/users/tsjippy/)
 * (@tsjippy)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/hooks-do-not-work/)
 * Thanks for his plugin, i works great.
    However the hook does not work, if I add
   this:
 *     ```
       //Exclude folders by default when cloning
       add_filter('wpstg_clone_excl_folders', 'custom_simnigeria_wpstg_exclude_folders_custom');
       function custom_simnigeria_wpstg_exclude_folders_custom($args){
       	error_log(print_r($args,true));
       	$folders = array('wp-staging', 'wp-fastest-cache', 'wp-2fa', 'super-progressive-web-apps', 'onesignal-free-web-push-notifications');
       	return array_merge($args, $folders);
       }
       ```
   
 * I get a lot of errors:
 * `trying to access array offset on value of type null in /.../public_html/wp-content/
   plugins/wp-staging/Core/Utils/Logger.php on line 146`

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Rene Hermenau](https://wordpress.org/support/users/renehermi/)
 * (@renehermi)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/hooks-do-not-work/#post-13398752)
 * [@tsjippy](https://wordpress.org/support/users/tsjippy/)
 * I’d like to offer you to have a look at that issue for you.
 * Can you send me the full code to support [at] wp-staging.com?
    Do you use the
   wp staging hooks plugin for adding the filter or did you add it into your functions.
   php?
 * Please check if you get the same error by using the hooks plugin:
    [https://github.com/WP-Staging/wp-staging-hooks/blob/master/wp-staging-hooks.php](https://github.com/WP-Staging/wp-staging-hooks/blob/master/wp-staging-hooks.php)
 * Cheers
    René
 *  Thread Starter [Ewald Harmsen](https://wordpress.org/support/users/tsjippy/)
 * (@tsjippy)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/hooks-do-not-work/#post-13614811)
 * its working now, but to prevent the logmessages I had to add the following:
 * file Logger.php line 152:
 *     ```
       if(is_array($message)){
       				$messageString .= "[{$message["type"]}]-[{$message["date"]}] {$message["message"]}".PHP_EOL;
       			}
       ```
   
 * file SearchReplace.php line 500:
    `if ($key === '' || is_int($key) || ord($key[
   0]) === 0) {`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘hooks do not work’ is closed to new replies.

 * ![](https://ps.w.org/wp-staging/assets/icon-256x256.png?rev=2972932)
 * [WP STAGING - WordPress Backup, Restore & Migration](https://wordpress.org/plugins/wp-staging/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-staging/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-staging/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-staging/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-staging/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-staging/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ewald Harmsen](https://wordpress.org/support/users/tsjippy/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/hooks-do-not-work/#post-13614811)
 * Status: resolved