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


PHP wpl_global::get_current_blog_id方法代碼示例

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


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

示例1: uninstall_wpl

 /**
  * Uninstalling WPL
  * @author Howard <howard@realtyna.com>
  * @return boolean
  */
 public function uninstall_wpl()
 {
     $tables = wpl_db::select('SHOW TABLES');
     $database = wpl_db::get_DBO();
     foreach ($tables as $table_name => $table) {
         if (strpos($table_name, $database->prefix . 'wpl_') !== false) {
             /** drop table **/
             wpl_db::q("DROP TABLE `{$table_name}`");
         }
     }
     /** delete options **/
     wpl_db::q("DELETE FROM `#__options` WHERE `option_name` LIKE 'wpl_%' AND `option_name` NOT LIKE 'wpl_theme%'", 'delete');
     /** remove WPL upload directory **/
     if (function_exists('is_multisite') and is_multisite() and wpl_global::check_addon('multisite')) {
         $original_blog_id = wpl_global::get_current_blog_id();
         // Get all blogs
         $blogs = wpl_db::select("SELECT `blog_id` FROM `#__blogs`", 'loadColumn');
         foreach ($blogs as $blog) {
             if (!isset($blog->blog_id)) {
                 continue;
             }
             switch_to_blog($blog->blog_id);
             $upload_path = wpl_global::get_upload_base_path($blog->blog_id);
             if (wpl_folder::exists($upload_path)) {
                 wpl_folder::delete($upload_path);
             }
         }
         switch_to_blog($original_blog_id);
     } else {
         $upload_path = wpl_global::get_upload_base_path();
         if (wpl_file::exists($upload_path)) {
             wpl_file::delete($upload_path);
         }
     }
     return true;
 }
開發者ID:amankatoch,項目名稱:wp-plugin,代碼行數:41,代碼來源:extensions.php

示例2: get_upload_base_url

 /**
  * This functions will take care of multisite usage
  * @author Howard <howard@realtyna.com>
  * @param type $blog_id
  * @return string WPL base url for uploaded files
  */
 public static function get_upload_base_url($blog_id = NULL)
 {
     if (!$blog_id) {
         $blog_id = wpl_global::get_current_blog_id();
     }
     $ABSPATH = WPL_UP_ABSPATH;
     if (!$blog_id or $blog_id == 1) {
         return wpl_global::get_wp_site_url() . 'wp-content/uploads/WPL/';
     } else {
         $path = rtrim($ABSPATH, DS) . $blog_id . DS;
         if (!wpl_folder::exists($path)) {
             wpl_folder::create($path);
         }
         return wpl_global::get_wp_site_url() . 'wp-content/uploads/WPL' . $blog_id . '/';
     }
 }
開發者ID:gvh1993,項目名稱:project-vvvh,代碼行數:22,代碼來源:global.php


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