Deprecated function split() / Strict Standards error
-
With
define('WP_DEBUG', true);inwp-config.phpsome 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 ofsplit()in line 90 and 547, see also http://www.php.net/manual/en/function.split.phpThis 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.
The topic ‘Deprecated function split() / Strict Standards error’ is closed to new replies.