Changeset 2398824
- Timestamp:
- 10/13/2020 04:29:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mapping-multiple-urls-redirect-same-page/trunk/mapping-multiple-urls-redirect-same-page.php
r2398815 r2398824 3 3 * Plugin Name: Mapping multiple URLs redirect same page 4 4 * Description: Mapping multiple URLs redirect same page,post,category,tags,custom post types. 5 * Version: 5.5 5 * Version: 5.5.1 6 6 * Author: Rupam Hazra 7 7 * Author URI: http://rstar.dx.am … … 134 134 { 135 135 global $wpdb; 136 require_once(ABSPATH . '/wp-admin/includes/upgrade.php'); 137 $charset_collate = ''; 138 if ( ! empty( $wpdb->charset ) ) 139 $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}"; 136 $installed_ver = get_option( "jal_db_version" ); 137 if ( $installed_ver != $jal_db_version ) { 138 require_once(ABSPATH . '/wp-admin/includes/upgrade.php'); 139 $charset_collate = ''; 140 if ( ! empty( $wpdb->charset ) ) 141 $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}"; 140 142 141 if ( ! empty( $wpdb->collate ) ) 142 $charset_collate .= " COLLATE {$wpdb->collate}"; 143 $table_name=$wpdb->prefix.'mmursp_settings'; 144 $sql = "CREATE TABLE IF NOT EXISTS " . $table_name . " ( 145 `id` int(11) NOT NULL AUTO_INCREMENT, 146 `category` varchar(50) NOT NULL, 147 `page_or_post_id` int(11) DEFAULT NULL, 148 `page_or_post_title` varchar(200) DEFAULT NULL, 149 `page_or_post_slug` varchar(50) DEFAULT NULL, 150 `post_of_custom_post_type` varchar(50) DEFAULT NULL, 151 `regular_expression` text DEFAULT NULL, 152 `is_seo` int(10) DEFAULT NULL, 153 `meta_title` text DEFAULT NULL, 154 `meta_keywords` text DEFAULT NULL, 155 `meta_description` text DEFAULT NULL, 156 `created_by` varchar(30) DEFAULT NULL, 157 `created_date` datetime DEFAULT NULL, 158 PRIMARY KEY (`id`) 159 ) $charset_collate;"; 160 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 161 dbDelta($sql); 143 if ( ! empty( $wpdb->collate ) ) 144 $charset_collate .= " COLLATE {$wpdb->collate}"; 145 $table_name=$wpdb->prefix.'mmursp_settings'; 146 $sql = "CREATE TABLE IF NOT EXISTS " . $table_name . " ( 147 `id` int(11) NOT NULL AUTO_INCREMENT, 148 `category` varchar(50) NOT NULL, 149 `page_or_post_id` int(11) DEFAULT NULL, 150 `page_or_post_title` varchar(200) DEFAULT NULL, 151 `page_or_post_slug` varchar(50) DEFAULT NULL, 152 `post_of_custom_post_type` varchar(50) DEFAULT NULL, 153 `regular_expression` text DEFAULT NULL, 154 `is_seo` int(10) DEFAULT NULL, 155 `meta_title` text DEFAULT NULL, 156 `meta_keywords` text DEFAULT NULL, 157 `meta_description` text DEFAULT NULL, 158 `created_by` varchar(30) DEFAULT NULL, 159 `created_date` datetime DEFAULT NULL, 160 PRIMARY KEY (`id`) 161 ) $charset_collate;"; 162 dbDelta($sql); 163 update_option( "jal_db_version", $jal_db_version ); 164 } 165 162 166 } 167 function myplugin_update_db_check() { 168 global $jal_db_version; 169 if ( get_site_option( 'jal_db_version' ) != $jal_db_version ) { 170 jal_install(); 171 } 172 } 173 add_action( 'plugins_loaded', 'myplugin_update_db_check' ); 163 174 function mmursp_remove_table() 164 175 {
Note: See TracChangeset
for help on using the changeset viewer.