$number,
'offset' => 0,
));
foreach ($myposts as $post): ?>
post_title)) ?>
$number,
'offset' => 0,
'orderby' => 'rand',
));
foreach ($myposts as $post): ?>
post_title)) ?>
';
}
public function update($new_instance, $old_instance)
{
$instance = array();
$instance['number'] = (!empty($new_instance['number'])) ? (int) $new_instance['number'] : 6;
/* `days` 已废弃:旧实现拿它当「最近 N 天发布」的时间窗,
* 那正是热点只显示一条的根因。这里不再保存,
* 老实例里残留的 days 值会在下次保存时被丢掉。 */
return $instance;
}
public function form($instance)
{
$number = !empty($instance['number']) ? $instance['number'] : '6';
?>