Changeset 2933566
- Timestamp:
- 07/03/2023 08:45:55 PM (3 years ago)
- Location:
- flow-fields/trunk
- Files:
-
- 4 edited
-
flow-fields.php (modified) (8 diffs)
-
includes/templates/admin_assets.php (modified) (1 diff)
-
includes/templates/create_admin_pages.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flow-fields/trunk/flow-fields.php
r2930614 r2933566 4 4 Plugin URI: https://flow.borowicz.me 5 5 Description: Manage fields and custom post types 6 Version: 1.1. 06 Version: 1.1.1 7 7 Author: Wojciech Borowicz 8 8 Author URI: https://borowicz.me … … 11 11 12 12 function flow_fields_check_db_version() { 13 if ( get_option( 'flow_fields_db_version' ) != '1.1. 0' ) {13 if ( get_option( 'flow_fields_db_version' ) != '1.1.1' ) { 14 14 create_flow_field_tables(); 15 15 } … … 22 22 $table_name = $wpdb->prefix . 'flow_boxes'; 23 23 24 update_option( 'flow_fields_db_version', '1.1.0' );25 24 25 26 update_option( 'flow_fields_db_version', '1.1.1' ); 27 28 26 29 $charset_collate = $wpdb->get_charset_collate(); 27 $sql = "CREATE TABLE $table_name (30 $sql = "CREATE TABLE IF NOT EXISTS $table_name ( 28 31 id INT NOT NULL AUTO_INCREMENT, 29 32 title VARCHAR(255) NOT NULL, … … 39 42 40 43 $table_name = $wpdb->prefix . 'flow_fields'; 41 $sql = "CREATE TABLE $table_name (44 $sql = "CREATE TABLE IF NOT EXISTS $table_name ( 42 45 id INT NOT NULL AUTO_INCREMENT, 43 46 box_id INT NOT NULL, … … 59 62 internal VARCHAR(255) NOT NULL, 60 63 parent_field INT NULL, 61 conditional JSONNULL,62 options_number JSONNULL,64 conditional TEXT NULL, 65 options_number TEXT NULL, 63 66 PRIMARY KEY (id), 64 67 FOREIGN KEY (box_id) REFERENCES {$wpdb->prefix}flow_boxes(id) … … 68 71 69 72 $table_name = $wpdb->prefix . 'flow_custom_post_types'; 70 $sql = "CREATE TABLE $table_name (73 $sql = "CREATE TABLE IF NOT EXISTS $table_name ( 71 74 id INT NOT NULL AUTO_INCREMENT, 72 75 post_type VARCHAR(255) NOT NULL, … … 123 126 124 127 dbDelta($sql); 128 125 129 } 126 130 register_activation_hook( __FILE__, 'create_flow_field_tables' ); … … 130 134 131 135 function drop_flow_field_tables() { 136 137 $option = get_option('flow_remove_on_deactivation'); 138 // proceed with this function only if the checkbox is selected 139 if ( $option != '1' ) { 140 return; 141 } 132 142 global $wpdb; 143 $table_name = $wpdb->prefix . 'flow_fields'; 144 $sql = "DROP TABLE IF EXISTS $table_name;"; 145 $wpdb->query( $sql ); 133 146 $table_name = $wpdb->prefix . 'flow_boxes'; 134 147 $sql = "DROP TABLE IF EXISTS $table_name;"; 135 148 $wpdb->query( $sql ); 136 $table_name = $wpdb->prefix . 'flow_fields'; 149 150 $table_name = $wpdb->prefix . 'flow_custom_post_types'; 151 $sql = "DROP TABLE IF EXISTS $table_name;"; 152 $wpdb->query( $sql ); 153 154 155 $table_name = $wpdb->prefix . 'flow_taxonomies'; 137 156 $sql = "DROP TABLE IF EXISTS $table_name;"; 138 157 $wpdb->query( $sql ); -
flow-fields/trunk/includes/templates/admin_assets.php
r2930614 r2933566 2 2 3 3 function flow_fields_admin_enqueue_scripts( $hook_suffix ) { 4 $plugin_version = '1.1. 0';4 $plugin_version = '1.1.1'; 5 5 wp_enqueue_script( 'flow-fields-js', plugins_url( '../../assets/flow-fields.js', __FILE__ ), array( 'jquery' ), $plugin_version, true ); 6 6 wp_enqueue_script( 'flow-relationship-fields-js', plugins_url( '../../assets/flow-relationship-fields.js', __FILE__ ), array( 'jquery', 'select2' ), $plugin_version, true ); -
flow-fields/trunk/includes/templates/create_admin_pages.php
r2930614 r2933566 119 119 register_setting('flow_fields_options', 'flow_fields_hide_helpers'); 120 120 register_setting('flow_fields_options', 'flow_fields_hide_plugin'); 121 register_setting('flow_fields_options', 'flow_remove_on_deactivation'); 121 122 add_settings_section( 122 123 'flow_fields_general_section', … … 133 134 ); 134 135 add_settings_field( 136 'flow_remove_on_deactivation', 137 'Remove Data on Deactivation', 138 'flow_remove_on_deactivation_callback', 139 'flow_field_boxes', 140 'flow_fields_general_section' 141 ); 142 add_settings_field( 135 143 'flow_fields_hide_helpers', 136 144 'Hide Helpers', … … 147 155 ); 148 156 } 157 158 function flow_remove_on_deactivation_callback() { 159 $option = get_option('flow_remove_on_deactivation'); 160 ?> 161 <label> 162 <input type="checkbox" name="flow_remove_on_deactivation" value="1" <?php checked(1, $option); ?> /> 163 Check this option to remove all Flow Fields data on deactivation 164 </label> 165 <?php 166 } 167 149 168 150 169 // Render the callback for the general settings section -
flow-fields/trunk/readme.txt
r2930614 r2933566 4 4 Requires at least: 5.0 5 5 Tested up to: 6.2.2 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 96 96 New : Taxonomies management initial release 97 97 98 = 1.1.1 = 99 Fix: Several DB and import tool fixes 100 New: Database removal on deactivation need to be set in the settings, as opposed to auto-removal 98 101 99 102 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.