当前位置: 首页>>代码示例>>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;未经允许,请勿转载。