Changeset 3338184
- Timestamp:
- 08/02/2025 10:33:15 AM (8 months ago)
- Location:
- my-text-shortcodes/trunk
- Files:
-
- 3 edited
-
includes/class-plugin.php (modified) (2 diffs)
-
my-text-shortcodes.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
my-text-shortcodes/trunk/includes/class-plugin.php
r3327046 r3338184 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_text_shortcodes` ( 29 `sh_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 30 `sh_title` VARCHAR(150) NOT NULL, 31 `sh_code` VARCHAR(25) NOT NULL, 32 `sh_description` text NOT NULL, 33 `sh_is_lock` TINYINT(1) UNSIGNED NOT NULL, 34 `sh_date_create` INT(10) UNSIGNED NOT NULL 35 ) {$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_text_shortcodes` ( 31 `sh_id` INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, 32 `sh_title` VARCHAR(150) NOT NULL, 33 `sh_code` VARCHAR(25) NOT NULL, 34 `sh_description` text NOT NULL, 35 `sh_is_lock` TINYINT(1) UNSIGNED NOT NULL, 36 `sh_date_create` INT(10) UNSIGNED NOT NULL 37 ) {$wpdb->get_charset_collate()};" 38 ); 39 } 36 40 ); 37 41 … … 45 49 */ 46 50 public static function uninstall() { 47 global $wpdb; 51 self::walk_site( 52 function() { 53 global $wpdb; 48 54 49 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- intentional schema change on uninstall 50 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'plance_text_shortcodes`' ); 55 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange -- intentional schema change on uninstall 56 $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'plance_text_shortcodes`' ); 57 } 58 ); 51 59 52 60 return true; 53 61 } 62 63 /** 64 * Walk site. 65 * 66 * @param callable $callback Callback. 67 * @return void 68 */ 69 private static function walk_site( $callback ) { 70 if ( is_multisite() ) { 71 $sites = get_sites(); 72 73 foreach ( $sites as $site ) { 74 switch_to_blog( $site->blog_id ); 75 76 call_user_func( $callback ); 77 78 restore_current_blog(); 79 } 80 } else { 81 call_user_func( $callback ); 82 } 83 } 54 84 } -
my-text-shortcodes/trunk/my-text-shortcodes.php
r3328422 r3338184 8 8 * Description: Creating text shortcodes, 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-text-shortcodes/trunk/readme.txt
r3328422 r3338184 4 4 Requires at least: 4.0.0 5 5 Tested up to: 6.8 6 Stable tag: 1.1. 16 Stable tag: 1.1.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 30 30 == Changelog == 31 = 1.1.2 = 32 * Added support for installing a plugin for the multisite. 33 31 34 = 1.1.1 = 32 35 * Change labels.
Note: See TracChangeset
for help on using the changeset viewer.