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


PHP cmb_Meta_Box::update_option方法代碼示例

本文整理匯總了PHP中cmb_Meta_Box::update_option方法的典型用法代碼示例。如果您正苦於以下問題:PHP cmb_Meta_Box::update_option方法的具體用法?PHP cmb_Meta_Box::update_option怎麽用?PHP cmb_Meta_Box::update_option使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cmb_Meta_Box的用法示例。


在下文中一共展示了cmb_Meta_Box::update_option方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: hijack_oembed_cache_set

 /**
  * Hijacks saving of cached oEmbed.
  * Saves cached data to relevant object metadata (vs postmeta)
  *
  * @since  0.9.5
  * @param  boolean $check Whether to continue setting postmeta
  * @param  int $object_id Object ID to get postmeta from
  * @param  string $meta_key Postmeta's key
  * @param  mixed $meta_value Value of the postmeta to be saved
  * @return boolean             Whether to continue setting
  */
 public static function hijack_oembed_cache_set($check, $object_id, $meta_key, $meta_value)
 {
     if (!self::$hijack || self::$object_id != $object_id && 1987645321 !== $object_id) {
         return $check;
     }
     // Cache the result to our metadata
     if ('options-page' === self::$object_type) {
         // Set the option
         cmb_Meta_Box::update_option(self::$object_id, self::$embed_args['cache_key'], $meta_value, array('type' => 'oembed'));
         // Save the option
         cmb_Meta_Box::save_option(self::$object_id);
     } else {
         update_metadata(self::$object_type, self::$object_id, $meta_key, $meta_value);
     }
     // Anything other than `null` to cancel saving to postmeta
     return true;
 }
開發者ID:Telemedellin,項目名稱:feriadelasfloresmedellin,代碼行數:28,代碼來源:cmb_Meta_Box_ajax.php

示例2: update_data

 /**
  * Updates metadata/option data
  * @since  1.0.1
  * @param  mixed $value  Value to update data with
  * @param  bool  $single Whether data is an array (add_metadata)
  */
 public function update_data($new_value, $single = true)
 {
     extract($this->data_args(array('new_value' => $new_value, 'single' => $single)));
     $new_value = $repeat ? array_values($new_value) : $new_value;
     if ('options-page' === $type) {
         return cmb_Meta_Box::update_option($id, $field_id, $new_value, $single);
     }
     if (!$single) {
         return add_metadata($type, $id, $field_id, $new_value, false);
     }
     return update_metadata($type, $id, $field_id, $new_value);
 }
開發者ID:Nirajjcu,項目名稱:minime3d,代碼行數:18,代碼來源:cmb_Meta_Box_field.php

示例3: oembed_cache_set

 /**
  * Saves the cached oEmbed value to relevant object metadata (vs postmeta)
  *
  * @since  1.3.0
  * @param  string  $meta_key   Postmeta's key
  * @param  mixed   $meta_value Value of the postmeta to be saved
  */
 public static function oembed_cache_set($meta_key, $meta_value)
 {
     // Cache the result to our metadata
     if ('options-page' === self::$object_type) {
         // Set the option
         cmb_Meta_Box::update_option(self::$object_id, self::$embed_args['cache_key'], $meta_value, array('type' => 'oembed'));
         // Save the option
         cmb_Meta_Box::save_option(self::$object_id);
     } else {
         update_metadata(self::$object_type, self::$object_id, $meta_key, $meta_value);
     }
 }
開發者ID:ryansm,項目名稱:saud,代碼行數:19,代碼來源:cmb_Meta_Box_ajax.php


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