Changeset 3338199
- Timestamp:
- 08/02/2025 11:31:34 AM (8 months ago)
- Location:
- my-maps/trunk
- Files:
-
- 3 edited
-
includes/class-plugin.php (modified) (2 diffs)
-
my-maps.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
my-maps/trunk/includes/class-plugin.php
r3330608 r3338199 21 21 */ 22 22 public static function activate() { 23 global $wpdb;24 25 23 require_once ABSPATH . 'wp-admin/includes/upgrade.php'; 26 24 27 dbDelta( 28 "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}plance_msm_maps` ( 29 `id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 30 `title` VARCHAR(255) NOT NULL, 31 `address` TEXT NOT NULL, 32 `date_create` INT(10) UNSIGNED NOT NULL 33 ) {$wpdb->get_charset_collate()};" 25 self::walk_site( 26 function() { 27 global $wpdb; 28 29 dbDelta( 30 "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}plance_msm_maps` ( 31 `id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 32 `title` VARCHAR(255) NOT NULL, 33 `address` TEXT NOT NULL, 34 `date_create` INT(10) UNSIGNED NOT NULL 35 ) {$wpdb->get_charset_collate()};" 36 ); 37 } 34 38 ); 35 39 … … 43 47 */ 44 48 public static function uninstall() { 45 global $wpdb; 49 self::walk_site( 50 function() { 51 global $wpdb; 46 52 47 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- intentional schema change on uninstall 48 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'plance_msm_maps`' ); 53 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- intentional schema change on uninstall 54 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'plance_msm_maps`' ); 55 } 56 ); 49 57 50 58 return true; 51 59 } 60 61 /** 62 * Walk site. 63 * 64 * @param callable $callback Callback. 65 * @return void 66 */ 67 private static function walk_site( $callback ) { 68 if ( is_multisite() ) { 69 $sites = get_sites(); 70 71 foreach ( $sites as $site ) { 72 switch_to_blog( $site->blog_id ); 73 74 call_user_func( $callback ); 75 76 restore_current_blog(); 77 } 78 } else { 79 call_user_func( $callback ); 80 } 81 } 52 82 } -
my-maps/trunk/my-maps.php
r3330642 r3338199 8 8 * Description: Creating shortcode maps, using friendly interface 9 9 * Plugin URI: https://plance.top/ 10 * Version: 1.1. 110 * Version: 1.1.2 11 11 * Author: plance 12 12 * Author URI: http://plance.top/ -
my-maps/trunk/readme.txt
r3330642 r3338199 47 47 == Changelog == 48 48 49 = 1.1.2 = 50 * Added support for installing a plugin for the multisite. 51 49 52 = 1.1.1 = 50 53 * Change help.
Note: See TracChangeset
for help on using the changeset viewer.