Changeset 3083670
- Timestamp:
- 05/09/2024 03:43:13 AM (22 months ago)
- Location:
- mxp-dev-tools
- Files:
-
- 5 edited
- 18 copied
-
tags/3.1.12 (copied) (copied from mxp-dev-tools/trunk)
-
tags/3.1.12/includes/assets/js/dashboard/app.js (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/dashboard/app.js)
-
tags/3.1.12/includes/assets/js/db-optimize/app.js (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/db-optimize/app.js)
-
tags/3.1.12/includes/assets/js/plugins-list/app.js (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/plugins-list/app.js)
-
tags/3.1.12/includes/assets/js/search-plugins/app.js (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/search-plugins/app.js)
-
tags/3.1.12/includes/assets/js/site-manager (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/site-manager)
-
tags/3.1.12/includes/assets/js/site-manager/app.js (copied) (copied from mxp-dev-tools/trunk/includes/assets/js/site-manager/app.js)
-
tags/3.1.12/includes/class_plugins_list_table.php (copied) (copied from mxp-dev-tools/trunk/includes/class_plugins_list_table.php)
-
tags/3.1.12/includes/db-optimize.php (copied) (copied from mxp-dev-tools/trunk/includes/db-optimize.php)
-
tags/3.1.12/includes/hooks-usage.php (copied) (copied from mxp-dev-tools/trunk/includes/hooks-usage.php)
-
tags/3.1.12/includes/plugins-list.php (copied) (copied from mxp-dev-tools/trunk/includes/plugins-list.php)
-
tags/3.1.12/includes/utility.php (copied) (copied from mxp-dev-tools/trunk/includes/utility.php)
-
tags/3.1.12/index.php (copied) (copied from mxp-dev-tools/trunk/index.php) (2 diffs)
-
tags/3.1.12/mxp-login-path.php (copied) (copied from mxp-dev-tools/trunk/mxp-login-path.php) (1 diff)
-
tags/3.1.12/mxp-site-manager.php (copied) (copied from mxp-dev-tools/trunk/mxp-site-manager.php) (2 diffs)
-
tags/3.1.12/mxp-snippets.php (copied) (copied from mxp-dev-tools/trunk/mxp-snippets.php) (8 diffs)
-
tags/3.1.12/readme.txt (copied) (copied from mxp-dev-tools/trunk/readme.txt) (2 diffs)
-
tags/3.1.12/uninstall.php (copied) (copied from mxp-dev-tools/trunk/uninstall.php)
-
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) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mxp-dev-tools/tags/3.1.12/index.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 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.1.1 0';41 static $VERSION = '3.1.12'; 42 42 private $themeforest_api_base_url = 'https://api.envato.com/v3'; 43 43 protected static $instance = null; -
mxp-dev-tools/tags/3.1.12/mxp-login-path.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ -
mxp-dev-tools/tags/3.1.12/mxp-site-manager.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 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.1.1 0';41 public static $VERSION = '3.1.12'; 42 42 43 43 public function __construct() { -
mxp-dev-tools/tags/3.1.12/mxp-snippets.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ … … 159 159 if (!defined("MDT_BLOCK_ALL_NETWORK_FUNCTION")) { 160 160 define('MDT_BLOCK_ALL_NETWORK_FUNCTION', false); 161 } 162 // 預設開啟登入後分權限轉址 163 if (!defined("MDT_ENABLE_LOGIN_REDIRECT")) { 164 define('MDT_ENABLE_LOGIN_REDIRECT', true); 165 } 166 // 開啟子主題下的 languages 目錄繼承翻譯 mo 檔案的功能 167 if (!defined("MDT_ENABLE_OVERWRITE_I18N_MO_FILE")) { 168 define('MDT_ENABLE_OVERWRITE_I18N_MO_FILE', true); 161 169 } 162 170 class MDTSnippets { … … 310 318 add_filter('login_headerurl', array($this, 'login_page_url')); 311 319 add_filter('login_headertext', array($this, 'login_page_url_title')); 312 add_filter('login_redirect', array($this, 'login_redirect'), 11, 3); 320 if (MDT_ENABLE_LOGIN_REDIRECT) { 321 add_filter('login_redirect', array($this, 'login_redirect'), 11, 3); 322 } 313 323 if (!empty(MDT_LOGINPAGE_LOGO_URL) && filter_var(MDT_LOGINPAGE_LOGO_URL, FILTER_VALIDATE_URL)) { 314 324 add_action('login_enqueue_scripts', array($this, 'login_css_enqueues')); … … 356 366 add_filter('pre_count_users', array($this, 'filter_user_counts'), 99999, 3); 357 367 } 368 if (MDT_ENABLE_OVERWRITE_I18N_MO_FILE) { 369 add_filter('load_textdomain_mofile', array($this, 'load_custom_translation_mo_file'), 12, 2); 370 } 371 } 372 373 public function load_custom_translation_mo_file($mofile, $domain) { 374 $overwrite_textdomains = apply_filters("mxp_dev_overwrite_i18n_textdomains", array('woocommerce')); 375 if (is_array($overwrite_textdomains) && in_array($domain, $overwrite_textdomains)) { 376 $theme_mofile = get_stylesheet_directory() . '/languages/' . $domain . '-' . get_locale() . '.mo'; 377 if (file_exists($theme_mofile)) { 378 return $theme_mofile; 379 } 380 } 381 return $mofile; 358 382 } 359 383 … … 439 463 $current_user = wp_get_current_user(); 440 464 //限制角色操作功能 441 $allowed_roles = apply_filters('mxp_dev_block_user_roles', array('administrator' ));465 $allowed_roles = apply_filters('mxp_dev_block_user_roles', array('administrator', 'shop_manager')); 442 466 if (array_intersect($allowed_roles, $current_user->roles)) { 443 467 update_user_meta($user_id, '_mxp_dev_block_user_check', intval($_POST['_mxp_dev_block_user_check'])); … … 775 799 //管理員等級的角色不要隱藏 admin bar 776 800 $user = wp_get_current_user(); 777 $allowed_roles = apply_filters('mxp_dev_show_admin_bar_roles', array('editor', 'administrator', 'author' ));801 $allowed_roles = apply_filters('mxp_dev_show_admin_bar_roles', array('editor', 'administrator', 'author', 'shop_manager')); 778 802 if (!array_intersect($allowed_roles, $user->roles)) { 779 803 add_filter('show_admin_bar', '__return_false'); … … 786 810 // 讓主題支援使用 WC 的方法 787 811 if (class_exists('WooCommerce')) { 788 add_theme_support('woocommerce');789 add_theme_support('wc-product-gallery-zoom');790 add_theme_support('wc-product-gallery-lightbox');791 add_theme_support('wc-product-gallery-slider');812 // add_theme_support('woocommerce'); 813 // add_theme_support('wc-product-gallery-zoom'); 814 // add_theme_support('wc-product-gallery-lightbox'); 815 // add_theme_support('wc-product-gallery-slider'); 792 816 } 793 817 } … … 1116 1140 return basename($plugin_path); 1117 1141 } 1118 return array("Name" => $plugin_data['Name'], "Version" => $plugin_data['Version'], "Author" => strip_tags($plugin_data['AuthorName']) );1142 return array("Name" => $plugin_data['Name'], "Version" => $plugin_data['Version'], "Author" => strip_tags($plugin_data['AuthorName']), "plugin_path" => $plugin_path); 1119 1143 } 1120 1144 -
mxp-dev-tools/tags/3.1.12/readme.txt
r3080385 r3083670 6 6 Requires PHP: 5.6 7 7 Tested up to: 6.5 8 Stable tag: 3.1.1 08 Stable tag: 3.1.12 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 77 77 78 78 == Changelog == 79 80 = 3.1.12 = 81 82 * 新增 Snippets 子主題下 languages 目錄繼承翻譯 mo 檔案的功能 83 * 修正小問題 79 84 80 85 = 3.1.10 = -
mxp-dev-tools/trunk/index.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 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.1.1 0';41 static $VERSION = '3.1.12'; 42 42 private $themeforest_api_base_url = 'https://api.envato.com/v3'; 43 43 protected static $instance = null; -
mxp-dev-tools/trunk/mxp-login-path.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ -
mxp-dev-tools/trunk/mxp-site-manager.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 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.1.1 0';41 public static $VERSION = '3.1.12'; 42 42 43 43 public function __construct() { -
mxp-dev-tools/trunk/mxp-snippets.php
r3080385 r3083670 7 7 * Requires PHP: 5.6 8 8 * Tested up to: 6.5 9 * Stable tag: 3.1.1 010 * Version: 3.1.1 09 * Stable tag: 3.1.12 10 * Version: 3.1.12 11 11 * Author: Chun 12 12 * Author URI: https://www.mxp.tw/contact/ … … 159 159 if (!defined("MDT_BLOCK_ALL_NETWORK_FUNCTION")) { 160 160 define('MDT_BLOCK_ALL_NETWORK_FUNCTION', false); 161 } 162 // 預設開啟登入後分權限轉址 163 if (!defined("MDT_ENABLE_LOGIN_REDIRECT")) { 164 define('MDT_ENABLE_LOGIN_REDIRECT', true); 165 } 166 // 開啟子主題下的 languages 目錄繼承翻譯 mo 檔案的功能 167 if (!defined("MDT_ENABLE_OVERWRITE_I18N_MO_FILE")) { 168 define('MDT_ENABLE_OVERWRITE_I18N_MO_FILE', true); 161 169 } 162 170 class MDTSnippets { … … 310 318 add_filter('login_headerurl', array($this, 'login_page_url')); 311 319 add_filter('login_headertext', array($this, 'login_page_url_title')); 312 add_filter('login_redirect', array($this, 'login_redirect'), 11, 3); 320 if (MDT_ENABLE_LOGIN_REDIRECT) { 321 add_filter('login_redirect', array($this, 'login_redirect'), 11, 3); 322 } 313 323 if (!empty(MDT_LOGINPAGE_LOGO_URL) && filter_var(MDT_LOGINPAGE_LOGO_URL, FILTER_VALIDATE_URL)) { 314 324 add_action('login_enqueue_scripts', array($this, 'login_css_enqueues')); … … 356 366 add_filter('pre_count_users', array($this, 'filter_user_counts'), 99999, 3); 357 367 } 368 if (MDT_ENABLE_OVERWRITE_I18N_MO_FILE) { 369 add_filter('load_textdomain_mofile', array($this, 'load_custom_translation_mo_file'), 12, 2); 370 } 371 } 372 373 public function load_custom_translation_mo_file($mofile, $domain) { 374 $overwrite_textdomains = apply_filters("mxp_dev_overwrite_i18n_textdomains", array('woocommerce')); 375 if (is_array($overwrite_textdomains) && in_array($domain, $overwrite_textdomains)) { 376 $theme_mofile = get_stylesheet_directory() . '/languages/' . $domain . '-' . get_locale() . '.mo'; 377 if (file_exists($theme_mofile)) { 378 return $theme_mofile; 379 } 380 } 381 return $mofile; 358 382 } 359 383 … … 439 463 $current_user = wp_get_current_user(); 440 464 //限制角色操作功能 441 $allowed_roles = apply_filters('mxp_dev_block_user_roles', array('administrator' ));465 $allowed_roles = apply_filters('mxp_dev_block_user_roles', array('administrator', 'shop_manager')); 442 466 if (array_intersect($allowed_roles, $current_user->roles)) { 443 467 update_user_meta($user_id, '_mxp_dev_block_user_check', intval($_POST['_mxp_dev_block_user_check'])); … … 775 799 //管理員等級的角色不要隱藏 admin bar 776 800 $user = wp_get_current_user(); 777 $allowed_roles = apply_filters('mxp_dev_show_admin_bar_roles', array('editor', 'administrator', 'author' ));801 $allowed_roles = apply_filters('mxp_dev_show_admin_bar_roles', array('editor', 'administrator', 'author', 'shop_manager')); 778 802 if (!array_intersect($allowed_roles, $user->roles)) { 779 803 add_filter('show_admin_bar', '__return_false'); … … 786 810 // 讓主題支援使用 WC 的方法 787 811 if (class_exists('WooCommerce')) { 788 add_theme_support('woocommerce');789 add_theme_support('wc-product-gallery-zoom');790 add_theme_support('wc-product-gallery-lightbox');791 add_theme_support('wc-product-gallery-slider');812 // add_theme_support('woocommerce'); 813 // add_theme_support('wc-product-gallery-zoom'); 814 // add_theme_support('wc-product-gallery-lightbox'); 815 // add_theme_support('wc-product-gallery-slider'); 792 816 } 793 817 } … … 1116 1140 return basename($plugin_path); 1117 1141 } 1118 return array("Name" => $plugin_data['Name'], "Version" => $plugin_data['Version'], "Author" => strip_tags($plugin_data['AuthorName']) );1142 return array("Name" => $plugin_data['Name'], "Version" => $plugin_data['Version'], "Author" => strip_tags($plugin_data['AuthorName']), "plugin_path" => $plugin_path); 1119 1143 } 1120 1144 -
mxp-dev-tools/trunk/readme.txt
r3080385 r3083670 6 6 Requires PHP: 5.6 7 7 Tested up to: 6.5 8 Stable tag: 3.1.1 08 Stable tag: 3.1.12 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 77 77 78 78 == Changelog == 79 80 = 3.1.12 = 81 82 * 新增 Snippets 子主題下 languages 目錄繼承翻譯 mo 檔案的功能 83 * 修正小問題 79 84 80 85 = 3.1.10 =
Note: See TracChangeset
for help on using the changeset viewer.