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


PHP wpl_global::switch_language方法代碼示例

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


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

示例1: finalize

 /**
  * Finalize User Profile
  * @author Howard R <howard@realtyna.com>
  * @static
  * @param int $user_id
  * @return boolean
  */
 public static function finalize($user_id)
 {
     /** create folder **/
     $folder_path = wpl_items::get_path($user_id, 2);
     if (!wpl_folder::exists($folder_path)) {
         wpl_folder::create($folder_path);
     }
     /** Multilingual **/
     if (wpl_global::check_multilingual_status()) {
         $languages = wpl_addon_pro::get_wpl_languages();
         $current_language = wpl_global::get_current_language();
         foreach ($languages as $language) {
             wpl_global::switch_language($language);
             /** Generate Rendered Data **/
             wpl_users::generate_rendered_data($user_id);
             wpl_users::update_text_search_field($user_id);
         }
         /** Switch to current language again **/
         wpl_global::switch_language($current_language);
     } else {
         /** Generate Rendered Data **/
         wpl_users::generate_rendered_data($user_id);
         wpl_users::update_text_search_field($user_id);
     }
     /** Generate Email Files **/
     wpl_users::generate_email_files($user_id);
     /** throwing event **/
     wpl_events::trigger('user_finalized', $user_id);
     return true;
 }
開發者ID:amankatoch,項目名稱:wp-plugin,代碼行數:37,代碼來源:users.php

示例2: finalize

 /**
  * Finalize a property and render needed data
  * @author Howard <howard@realtyna.com>
  * @static
  * @param int $property_id
  * @param string $mode
  * @param int $user_id
  * @return boolean
  */
 public static function finalize($property_id, $mode = 'edit', $user_id = '')
 {
     $property = self::get_property_raw_data($property_id);
     $update_query = self::generate_finalize_query($property, $property_id);
     $update_query .= "`finalized`='1',";
     if (wpl_global::check_access('confirm', $user_id)) {
         $update_query .= "`confirmed`='1',";
     }
     $update_query = trim($update_query, ', ');
     $query = "UPDATE `#__wpl_properties` SET " . $update_query . " WHERE `id`='{$property_id}'";
     wpl_db::q($query, 'update');
     /** Remove Property Cache **/
     wpl_property::clear_property_cache($property_id);
     /** Multilingual **/
     if (wpl_global::check_multilingual_status()) {
         $languages = wpl_addon_pro::get_wpl_languages();
         $current_language = wpl_global::get_current_language();
         foreach ($languages as $language) {
             wpl_global::switch_language($language);
             wpl_property::update_text_search_field($property_id);
             wpl_property::update_alias($property);
             wpl_property::update_property_page_title($property);
             wpl_property::update_property_title($property);
             /** generate rendered data **/
             wpl_property::generate_rendered_data($property_id);
         }
         /** Switch to current language again **/
         wpl_global::switch_language($current_language);
     } else {
         wpl_property::update_text_search_field($property_id);
         wpl_property::update_alias($property);
         wpl_property::update_property_page_title($property);
         wpl_property::update_property_title($property);
         /** generate rendered data **/
         wpl_property::generate_rendered_data($property_id);
     }
     /** Fixes **/
     wpl_property::fix_aliases($property, $property_id);
     wpl_property::update_numbs($property_id, $property);
     /** throwing events **/
     if ($mode == 'add') {
         wpl_events::trigger('add_property', $property_id);
     } elseif ($mode == 'edit') {
         wpl_events::trigger('edit_property', $property_id);
     }
     if (wpl_global::check_access('confirm', $user_id)) {
         wpl_events::trigger('property_confirm', $property_id);
     }
     return true;
 }
開發者ID:amankatoch,項目名稱:wp-plugin,代碼行數:59,代碼來源:property.php


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