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