• Hi,
    php8 and last version of WordPress, kingcomposer 2.9.6, i have no on all my pages on top error messages :

    Deprecated: uksort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /home/zecom/arcr/wp-content/plugins/kingcomposer/includes/kc.functions.php on line 862

    how can i solve this trouble ? i already re install my them and also the extension kc itself, pb still the same.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Three months and no response. Is there no support!

    /wp-content/plugins/kingcomposer/includes/kc.functions.php
    return (array_search($key1, $screens) > array_search($key2, $screens));

    After fixing it ..
    return (array_search($key1, $screens) <=> array_search($key2, $screens));

    line 858~873

    function kc_screen_sort( array &$array ) {
    	$screens = array('any', '1000-5000', '1024', '999', '767', '479');
    	uksort($array, function($key1, $key2) use ($screens) {
    		return (array_search($key1, $screens) <=> array_search($key2, $screens));
    	});
    }
    
    /*
     * Sort first array base on key as array second
     */
    function kc_abasort( array &$array, $order ) {
    	$order = array('any', '1000-5000', '1024', '999', '767', '479');
    	uksort($array, function($key1, $key2) use ($order) {
    		return (array_search($key1, $order) <=> array_search($key2, $order));
    	});
    }

    https://lindevs.com/sort-comparison-functions-that-return-boolean-value-is-deprecated-in-php-8-0/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deprecated: uksort(): Returning bool from comparison function is deprecated, ret’ is closed to new replies.