當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_Widget::update方法代碼示例

本文整理匯總了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;
 }
開發者ID:donwea,項目名稱:nhap.org,代碼行數:9,代碼來源:widget-venue.class.php

示例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;
 }
開發者ID:thinh9012,項目名稱:Wordpress,代碼行數:9,代碼來源:widgetqthinh.php

示例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;
 }
開發者ID:TakenCdosG,項目名稱:chefs,代碼行數:14,代碼來源:Venue_Widget.php

示例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;
 }
開發者ID:mpaskew,項目名稱:isc-dev,代碼行數:19,代碼來源:tribe-related-posts-widget.php

示例5: update

 function update($new_instance, $old_instance)
 {
     $instance = parent::update($new_instance, $old_instance);
     $instance['full'] = $new_instance['full'];
     return $instance;
 }
開發者ID:mauricioabisay,項目名稱:nwm-loc,代碼行數:6,代碼來源:widgets.php

示例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;
 }
開發者ID:khiconit,項目名稱:makeclean,代碼行數:16,代碼來源:class-wc-slide-widget.php


注:本文中的WP_Widget::update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。