Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../includes/Database/Migratio...
File: Fields.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
class NF_Database_Migrations_Fields extends NF_Abstracts_Migration
[2] Fix | Delete
{
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Constructor method for the NF_Database_Migrations_Fields class.
[6] Fix | Delete
*
[7] Fix | Delete
* @since 3.0.0
[8] Fix | Delete
*/
[9] Fix | Delete
public function __construct()
[10] Fix | Delete
{
[11] Fix | Delete
parent::__construct(
[12] Fix | Delete
'nf3_fields',
[13] Fix | Delete
'nf_migration_create_table_fields'
[14] Fix | Delete
);
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Function to run our initial migration.
[19] Fix | Delete
*
[20] Fix | Delete
* @since 3.0.0
[21] Fix | Delete
*
[22] Fix | Delete
* @updated 3.4.0
[23] Fix | Delete
*/
[24] Fix | Delete
public function run()
[25] Fix | Delete
{
[26] Fix | Delete
$query = "CREATE TABLE IF NOT EXISTS {$this->table_name()} (
[27] Fix | Delete
`id` int NOT NULL AUTO_INCREMENT,
[28] Fix | Delete
`label` longtext,
[29] Fix | Delete
`key` longtext,
[30] Fix | Delete
`type` longtext,
[31] Fix | Delete
`parent_id` int NOT NULL,
[32] Fix | Delete
`created_at` TIMESTAMP,
[33] Fix | Delete
`updated_at` DATETIME,
[34] Fix | Delete
`field_label` longtext,
[35] Fix | Delete
`field_key` longtext,
[36] Fix | Delete
`order` int(11),
[37] Fix | Delete
`required` bit,
[38] Fix | Delete
`default_value` longtext,
[39] Fix | Delete
`label_pos` varchar(15),
[40] Fix | Delete
`personally_identifiable` bit,
[41] Fix | Delete
UNIQUE KEY (`id`)
[42] Fix | Delete
) {$this->charset_collate( true )};";
[43] Fix | Delete
[44] Fix | Delete
dbDelta( $query );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* Function to run our stage two upgrades.
[49] Fix | Delete
*
[50] Fix | Delete
* @since 3.3.12
[51] Fix | Delete
*
[52] Fix | Delete
* @updated 3.4.0
[53] Fix | Delete
*/
[54] Fix | Delete
public function cache_collate_fields()
[55] Fix | Delete
{
[56] Fix | Delete
// If the field_label column has not already been defined...
[57] Fix | Delete
if ( ! $this->column_exists( 'field_label' ) ) {
[58] Fix | Delete
global $wpdb;
[59] Fix | Delete
// Modify our table.
[60] Fix | Delete
$query = "ALTER TABLE {$this->table_name()}
[61] Fix | Delete
ADD `field_label` longtext {$this->charset_collate()},
[62] Fix | Delete
ADD `field_key` longtext {$this->charset_collate()},
[63] Fix | Delete
ADD `order` int(11),
[64] Fix | Delete
ADD `required` bit,
[65] Fix | Delete
ADD `default_value` longtext {$this->charset_collate()},
[66] Fix | Delete
ADD `label_pos` varchar(15) {$this->charset_collate()},
[67] Fix | Delete
ADD `personally_identifiable` bit,
[68] Fix | Delete
MODIFY `type` longtext {$this->charset_collate()};";
[69] Fix | Delete
$wpdb->query( $query );
[70] Fix | Delete
}
[71] Fix | Delete
}
[72] Fix | Delete
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function