以下是我的函数,它不起作用:
function ts_dynamic_sidebar_params($params) {
global $wp_registered_widgets;
$settings_getter = $wp_registered_widgets[ $params[0][\'widget_id\'] ][\'callback\'][0];
$settings = $settings_getter->get_settings();
$settings = $settings[ $params[1][\'number\'] ];
if ( isset($settings[\'title\']) ) {
$params[0][\'before_widget\'] = \'<div class="widget">Widget Has Title\';
}
return $params;
}
add_filter(\'dynamic_sidebar_params\', \'ts_dynamic_sidebar_params\');
谁都知道为什么
if ( isset($settings[\'title\']) )
这里没有按预期工作?