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


PHP ThemexCore::updatePostMeta方法代碼示例

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


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

示例1: removeUser

 /**
  * Removes course member
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function removeUser($ID, $user)
 {
     self::refresh($ID);
     if (self::isMember($user)) {
         ThemexCore::removeUserRelation($user, self::$data['ID'], 'course');
         $number = count(self::$data['users']) - 1;
         ThemexCore::updatePostMeta(self::$data['ID'], 'course_popularity', $number);
     }
 }
開發者ID:rinodung,項目名稱:wordpress-demo,代碼行數:16,代碼來源:themex.course.php

示例2: addOrder

 /**
  * Adds order
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function addOrder($ID)
 {
     $order = wc_get_order($ID);
     $products = $order->get_items();
     //set author
     if (!empty($products)) {
         $product = reset($products);
         $post = get_post($product['product_id']);
         //set affiliate
         $referral = get_current_user_id();
         $affiliate = self::getAffiliate();
         if (!empty($affiliate) && $affiliate != $referral) {
             ThemexCore::updatePostMeta($ID, 'affiliate', $affiliate);
             self::removeAffiliate();
             //send email
             $content = ThemexCore::getOption('email_order_referral');
             if (!empty($content)) {
                 $user = get_userdata($affiliate);
                 if ($user !== false) {
                     $subject = __('New Referral', 'makery');
                     $keywords = array('username' => $user->user_login, 'order' => '<a href="' . ThemexCore::getURL('profile-referrals') . '">' . $order->get_order_number() . '</a>');
                     $content = themex_keywords($content, $keywords);
                     themex_mail($user->user_email, $subject, $content);
                 }
             }
         }
         if (!empty($post)) {
             wp_update_post(array('ID' => $ID, 'post_author' => $post->post_author));
             //send email
             $content = ThemexCore::getOption('email_order_received');
             if (!empty($content)) {
                 $user = get_userdata($post->post_author);
                 $subject = __('New Order', 'makery');
                 $keywords = array('username' => $user->user_login, 'order' => '<a href="' . ThemexCore::getURL('shop-order', $order->id) . '">' . $order->get_order_number() . '</a>');
                 $content = themex_keywords($content, $keywords);
                 themex_mail($user->user_email, $subject, $content);
             }
         }
     }
 }
開發者ID:qhuit,項目名稱:UrbanPekor,代碼行數:47,代碼來源:themex.woo.php

示例3: removeRelation

 /**
  * Removes user relation
  *
  * @access public
  * @param int $ID
  * @param array $data
  * @return void
  */
 public static function removeRelation($ID, $data)
 {
     $relation = themex_value('relation_id', $data);
     $type = themex_value('relation_type', $data);
     if (in_array($type, array('shop', 'product'))) {
         ThemexCore::removeUserRelation($ID, $relation, $type);
         if ($type == 'shop') {
             $relations = count(ThemexCore::getUserRelations(0, $relation, 'shop'));
             ThemexCore::updatePostMeta($relation, 'admirers', $relations);
         }
     }
     die;
 }
開發者ID:qhuit,項目名稱:UrbanPekor,代碼行數:21,代碼來源:themex.user.php

示例4: updateRating

 /**
  * Updates shop rating
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function updateRating($ID)
 {
     $rating = get_comment_meta($ID, 'rating', true);
     if (!empty($rating)) {
         $comment = get_comment($ID);
         $user = get_post_field('post_author', $comment->comment_post_ID);
         $shop = ThemexUser::getShop($user);
         $rating = ThemexWoo::getRating($user);
         ThemexCore::updatePostMeta($shop, 'rating', $rating['rating']);
         ThemexCore::updatePostMeta($shop, 'ratings', $rating['ratings']);
     }
 }
開發者ID:TheTypoMaster,項目名稱:wp_marketplace,代碼行數:19,代碼來源:themex.shop.php


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