Warning: array_keys () expects parameter 1 to be array, object given in ... (error in Wordpress theme)

0

In a theme I had installed in my wordpress, the following errors have recently emerged after the platform was updated:

  

Warning: array_keys () expects parameter 1 to be array, object given in   (...) \ wp-content \ themes \ event \ inc \ lib \ td-colors.php on   line 7

and also:

  

Warning: max (): When only one parameter is given, it must be an array   in (...) \ wp-content \ themes \ event \ inc \ lib \ td-colors.php on line 7

Reviewing the file in the indicated position, I find this code:

1    <?php 
2    function themesdojo_wpcss_loaded() {
3    
4       // Return the lowest priority number from all the functions that hook 5 into wp_head
6       global $wp_filter;
7       $lowest_priority = max(array_keys($wp_filter['wp_head']));
8     
9       add_action('wp_head', 'themesdojo_wpcss_head', $lowest_priority + 1);
10     
11      $arr = $wp_filter['wp_head'];
12    
13    }
14    add_action('wp_head', "themesdojo_wpcss_loaded");
15     
16    // wp_head callback functions
17    function themesdojo_wpcss_head() {

I can not determine what the problem is in the structure of the code. Someone with some idea? In advance, thanks

    
asked by Alex Aguilar 09.04.2017 в 21:33
source

0 answers