本文整理汇总了PHP中WP_Widget::update方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Widget::update方法的具体用法?PHP WP_Widget::update怎么用?PHP WP_Widget::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Widget
的用法示例。
在下文中一共展示了WP_Widget::update方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
function update($new_instance, $old_instance)
{
$instance = parent::update($new_instance, $old_instance);
$instance['title'] = $new_instance['title'];
$instance['venue_ID'] = $new_instance['venue_ID'];
$instance['count'] = $new_instance['count'];
$instance['hide_if_empty'] = $new_instance['hide_if_empty'];
return $instance;
}
示例2: update
function update($new_instance, $old_instance)
{
parent::update($new_instance, $old_instance);
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['number_post'] = strip_tags($new_instance['number_post']);
$instance['current_category'] = strip_tags($new_instance['current_category']);
return $instance;
}
示例3: update
public function update($new_instance, $old_instance)
{
$instance = parent::update($new_instance, $old_instance);
$instance['title'] = $new_instance['title'];
$instance['venue_ID'] = $new_instance['venue_ID'];
$instance['count'] = $new_instance['count'];
$instance['hide_if_empty'] = $new_instance['hide_if_empty'];
if (isset($new_instance['jsonld_enable']) && $new_instance['jsonld_enable'] == true) {
$instance['jsonld_enable'] = 1;
} else {
$instance['jsonld_enable'] = 0;
}
return $instance;
}
示例4: update
/**
* Function allowing updating of widget information.
*
* @since 1.1
* @author Paul Hughes
* @param array $new_instance new instance variables.
* @param array $old_instance old instance variables.
* @return array $instance the returned new instance variable values.
*/
function update($new_instance, $old_instance)
{
$instance = parent::update($new_instance, $old_instance);
$instance['title'] = $new_instance['title'];
$instance['count'] = $new_instance['count'];
$instance['thumbnails'] = isset($new_instance['thumbnails']) ? true : false;
$instance['only_display_related'] = isset($new_instance['only_display_related']) ? true : false;
$instance['post_type'] = $new_instance['post_type'];
return $instance;
}
示例5: update
function update($new_instance, $old_instance)
{
$instance = parent::update($new_instance, $old_instance);
$instance['full'] = $new_instance['full'];
return $instance;
}
示例6: update
/**
* Processing widget options on save
*
* @param array $new_instance The new options
* @param array $old_instance The previous options
*/
public function update($new_instance, $old_instance)
{
// processes widget options to be saved
parent::update($new_instance, $old_instance);
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['image'] = esc_url($new_instance['image']);
$instance['link'] = esc_url($new_instance['link']);
return $instance;
}