Changeset 3343244
- Timestamp:
- 08/12/2025 03:34:33 AM (5 months ago)
- Location:
- mxp-dev-tools
- Files:
-
- 10 edited
- 1 copied
-
tags/3.3.6 (copied) (copied from mxp-dev-tools/trunk)
-
tags/3.3.6/index.php (modified) (2 diffs)
-
tags/3.3.6/mxp-login-path.php (modified) (1 diff)
-
tags/3.3.6/mxp-site-manager.php (modified) (2 diffs)
-
tags/3.3.6/mxp-snippets.php (modified) (6 diffs)
-
tags/3.3.6/readme.txt (modified) (2 diffs)
-
trunk/index.php (modified) (2 diffs)
-
trunk/mxp-login-path.php (modified) (1 diff)
-
trunk/mxp-site-manager.php (modified) (2 diffs)
-
trunk/mxp-snippets.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mxp-dev-tools/tags/3.3.6/index.php
r3285988 r3343244 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.8 9 * Stable tag: 3.3. 510 * Version: 3.3. 59 * Stable tag: 3.3.6 10 * Version: 3.3.6 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ … … 39 39 use SearchReplace; 40 40 use Utility; 41 static $VERSION = '3.3. 5';41 static $VERSION = '3.3.6'; 42 42 private $themeforest_api_base_url = 'https://api.envato.com/v3'; 43 43 protected static $instance = null; -
mxp-dev-tools/tags/3.3.6/mxp-login-path.php
r3285988 r3343244 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.8 9 * Stable tag: 3.3. 510 * Version: 3.3. 59 * Stable tag: 3.3.6 10 * Version: 3.3.6 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ -
mxp-dev-tools/tags/3.3.6/mxp-site-manager.php
r3285988 r3343244 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.8 9 * Stable tag: 3.3. 510 * Version: 3.3. 59 * Stable tag: 3.3.6 10 * Version: 3.3.6 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ … … 39 39 class MDTSiteManager { 40 40 public $plugin_slug = 'mdt-site-manager'; 41 public static $VERSION = '3.3. 5';41 public static $VERSION = '3.3.6'; 42 42 43 43 public function __construct() { -
mxp-dev-tools/tags/3.3.6/mxp-snippets.php
r3285988 r3343244 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.8 9 * Stable tag: 3.3. 510 * Version: 3.3. 59 * Stable tag: 3.3.6 10 * Version: 3.3.6 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ … … 114 114 // 單獨給指定的管理員開啟後台檔案形式操作,陣列指定管理員ID 115 115 if (!defined('MDT_DISALLOW_FILE_MODS_ADMINS')) { 116 define('MDT_DISALLOW_FILE_MODS_ADMINS', array(1)); 116 // 沒指定的話,預設先抓當前所有管理員 117 global $wpdb; 118 119 $admin_ids = []; 120 121 // 當前站點的 capabilities meta_key 122 $cap_meta_key = $wpdb->get_blog_prefix() . 'capabilities'; 123 124 // 取得當前站點 Administrator ID 125 $site_admin_ids = $wpdb->get_col($wpdb->prepare( 126 "SELECT user_id 127 FROM {$wpdb->usermeta} 128 WHERE meta_key = %s 129 AND meta_value LIKE %s", 130 $cap_meta_key, 131 '%\"administrator\"%' 132 )); 133 $admin_ids = array_merge($admin_ids, array_map('intval', $site_admin_ids)); 134 135 // 如果是 Multisite,抓取 Super Admin 136 if (is_multisite()) { 137 // 取得 super admin 帳號名稱 138 $super_admins = maybe_unserialize($wpdb->get_var($wpdb->prepare( 139 "SELECT meta_value FROM {$wpdb->sitemeta} WHERE meta_key = %s", 140 'site_admins' 141 ))); 142 143 if (is_array($super_admins) && $super_admins) { 144 // 轉換 super admin 帳號名稱為 ID 145 $placeholders = implode(',', array_fill(0, count($super_admins), '%s')); 146 $sql = "SELECT ID FROM {$wpdb->users} WHERE user_login IN ($placeholders)"; 147 $super_admin_ids = $wpdb->get_col($wpdb->prepare($sql, ...$super_admins)); 148 $admin_ids = array_merge($admin_ids, array_map('intval', $super_admin_ids)); 149 } 150 } 151 152 // 去重 153 $admin_ids = array_values(array_unique($admin_ids)); 154 define('MDT_DISALLOW_FILE_MODS_ADMINS', $admin_ids); 117 155 } 118 156 // 顯示後台內容的系統編號 …