WordPress.org

Support

Support » Plugins and Hacks » WP Native Dashboard » Deprecated function split() / Strict Standards error

Deprecated function split() / Strict Standards error

  • With define('WP_DEBUG', true); in wp-config.php some errors can be observed on settings page of WP Native Dashboard:

    At each entry of installed languages:

    Deprecated: Function split() is deprecated in …/wp-content/plugins/wp-native-dashboard/wp-native-dashboard.php on line 90

    Strict Standards: Only variables should be passed by reference in …/wp-content/plugins/wp-native-dashboard/wp-native-dashboard.php on line 90

    At downloads:

    Deprecated: Function split() is deprecated in …/wp-content/plugins/wp-native-dashboard/wp-native-dashboard.php on line 547

    File wp-native-dashboard.php:

    Suggested fix 1: Use explode() instead of split() in line 90 and 547, see also http://www.php.net/manual/en/function.split.php

    This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

    Suggested fix 2, line 90, currect version:

    function wp_native_dashboard_is_rtl_language($locale) {
    	$rtl = array('ar', 'ckb', 'fa', 'he', 'ur', 'ug');
    	return in_array(array_shift(split('_',$locale)), $rtl);
    }

    Changed version, array_shift ( array &$array ) requires a variable by reference instead of just a function result:

    function wp_native_dashboard_is_rtl_language($locale) {
    	$rtl = array('ar', 'ckb', 'fa', 'he', 'ur', 'ug');
    	$lang = explode('_',$locale);
    	return in_array(array_shift($lang), $rtl);
    }

    Thanks for the great plugin.

    http://wordpress.org/plugins/wp-native-dashboard/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deprecated function split() / Strict Standards error’ is closed to new replies.
Skip to toolbar