Warning: array_keys() expects parameter 1 to be array,

后端 未结 2 1869
别那么骄傲
别那么骄傲 2021-01-23 03:42

I am getting the following warnings:

Warning: array_keys() expects parameter 1 to be array, object given in /home/inin3486/public_html/wordpress/wp-conten

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-23 04:16

    Simply change the code from line 1 to 14:

    function wpcrown_wpcss_loaded() {
    
        // Return the lowest priority number from all the functions that hook into wp_head
        global $wp_filter;
        //$lowest_priority = max(array_keys($wp_filter['wp_head'])); (I made this comment)
    
        add_action('wp_head', 'wpcrown_wpcss_head', $lowest_priority + 1);
    
        $arr = $wp_filter['wp_head'];}
    
    add_action('wp_head', "wpcrown_wpcss_loaded",$lowest_priority);
    

提交回复
热议问题