Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../deprecat.../includes
File: database.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
// Begin Form Interaction Functions
[2] Fix | Delete
[3] Fix | Delete
function ninja_forms_insert_field( $form_id, $args = array() ){
[4] Fix | Delete
global $wpdb;
[5] Fix | Delete
$insert_array = array();
[6] Fix | Delete
[7] Fix | Delete
$insert_array['type'] = $args['type'];
[8] Fix | Delete
$insert_array['form_id'] = $form_id;
[9] Fix | Delete
[10] Fix | Delete
if( isset( $args['data'] ) ){
[11] Fix | Delete
$insert_array['data'] = $args['data'];
[12] Fix | Delete
}else{
[13] Fix | Delete
$insert_array['data'] = '';
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
if( isset( $args['order'] ) ){
[17] Fix | Delete
$insert_array['order'] = $args['order'];
[18] Fix | Delete
}else{
[19] Fix | Delete
$insert_array['order'] = 999;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if( isset( $args['fav_id'] ) ){
[23] Fix | Delete
$insert_array['fav_id'] = $args['fav_id'];
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
if( isset( $args['def_id'] ) ){
[27] Fix | Delete
$insert_array['def_id'] = $args['def_id'];
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
$new_field = $wpdb->insert( NINJA_FORMS_FIELDS_TABLE_NAME, $insert_array );
[31] Fix | Delete
$new_id = $wpdb->insert_id;
[32] Fix | Delete
return $new_id;
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
function ninja_forms_get_form_ids_by_post_id( $post_id ){
[36] Fix | Delete
global $wpdb;
[37] Fix | Delete
$form_ids = array();
[38] Fix | Delete
if( is_page( $post_id ) ){
[39] Fix | Delete
$form_results = ninja_forms_get_all_forms();
[40] Fix | Delete
if(is_array($form_results) AND !empty($form_results)){
[41] Fix | Delete
foreach($form_results as $form){
[42] Fix | Delete
$form_data = $form['data'];
[43] Fix | Delete
if(isset($form_data['append_page']) AND !empty($form_data['append_page'])){
[44] Fix | Delete
if($form_data['append_page'] == $post_id){
[45] Fix | Delete
$form_ids[] = $form['id'];
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
$form_id = get_post_meta( $post_id, 'ninja_forms_form', true );
[51] Fix | Delete
if( !empty( $form_id ) ){
[52] Fix | Delete
$form_ids[] = $form_id;
[53] Fix | Delete
}
[54] Fix | Delete
}else if( is_single( $post_id ) ){
[55] Fix | Delete
$form_id = get_post_meta( $post_id, 'ninja_forms_form', true );
[56] Fix | Delete
if( !empty( $form_id ) ){
[57] Fix | Delete
$form_ids[] = $form_id;
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
return $form_ids;
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
function ninja_forms_get_form_by_sub_id( $sub_id ){
[65] Fix | Delete
global $wpdb;
[66] Fix | Delete
$form_id = Ninja_Forms()->sub( $sub_id )->form_id;
[67] Fix | Delete
$form_row = ninja_forms_get_form_by_id( $form_id );
[68] Fix | Delete
return $form_row;
[69] Fix | Delete
}
[70] Fix | Delete
[71] Fix | Delete
// The ninja_forms_delete_form( $form_id ) function is in includes/deprecated.php
[72] Fix | Delete
[73] Fix | Delete
// Begin Field Interaction Functions
[74] Fix | Delete
[75] Fix | Delete
function ninja_forms_get_field_by_id($field_id){
[76] Fix | Delete
global $wpdb;
[77] Fix | Delete
$field_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FIELDS_TABLE_NAME." WHERE id = %d", $field_id), ARRAY_A);
[78] Fix | Delete
if( $field_row != null ){
[79] Fix | Delete
$field_row['data'] = unserialize($field_row['data']);
[80] Fix | Delete
return $field_row;
[81] Fix | Delete
}else{
[82] Fix | Delete
return false;
[83] Fix | Delete
}
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
function ninja_forms_get_fields_by_form_id($form_id, $orderby = 'ORDER BY `order` ASC'){
[87] Fix | Delete
global $wpdb;
[88] Fix | Delete
[89] Fix | Delete
$field_results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FIELDS_TABLE_NAME." WHERE form_id = %d ".$orderby, $form_id), ARRAY_A);
[90] Fix | Delete
if(is_array($field_results) AND !empty($field_results)){
[91] Fix | Delete
$x = 0;
[92] Fix | Delete
$count = count($field_results) - 1;
[93] Fix | Delete
while($x <= $count){
[94] Fix | Delete
$field_results[$x]['data'] = unserialize($field_results[$x]['data']);
[95] Fix | Delete
$x++;
[96] Fix | Delete
}
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
return $field_results;
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
function ninja_forms_get_all_fields(){
[103] Fix | Delete
global $wpdb;
[104] Fix | Delete
$field_results = $wpdb->get_results("SELECT * FROM ".NINJA_FORMS_FIELDS_TABLE_NAME, ARRAY_A);
[105] Fix | Delete
if(is_array($field_results) AND !empty($field_results)){
[106] Fix | Delete
$x = 0;
[107] Fix | Delete
$count = count($field_results) - 1;
[108] Fix | Delete
while($x <= $count){
[109] Fix | Delete
$field_results[$x]['data'] = unserialize($field_results[$x]['data']);
[110] Fix | Delete
$x++;
[111] Fix | Delete
}
[112] Fix | Delete
}
[113] Fix | Delete
return $field_results;
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
function ninja_forms_update_field($args){
[117] Fix | Delete
global $wpdb;
[118] Fix | Delete
$update_array = $args['update_array'];
[119] Fix | Delete
$where = $args['where'];
[120] Fix | Delete
$wpdb->update(NINJA_FORMS_FIELDS_TABLE_NAME, $update_array, $where);
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
function ninja_forms_delete_field( $field_id ){
[124] Fix | Delete
global $wpdb;
[125] Fix | Delete
$wpdb->query($wpdb->prepare("DELETE FROM ".NINJA_FORMS_FIELDS_TABLE_NAME." WHERE id = %d", $field_id), ARRAY_A);
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
// Begin Favorite Fields Interaction Functions
[129] Fix | Delete
[130] Fix | Delete
function ninja_forms_get_fav_by_id($fav_id){
[131] Fix | Delete
global $wpdb;
[132] Fix | Delete
$fav_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FAV_FIELDS_TABLE_NAME." WHERE id = %d", $fav_id), ARRAY_A);
[133] Fix | Delete
$fav_row['data'] = unserialize($fav_row['data']);
[134] Fix | Delete
[135] Fix | Delete
return $fav_row;
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
function ninja_forms_delete_fav_by_id($fav_id){
[139] Fix | Delete
global $wpdb;
[140] Fix | Delete
$wpdb->query($wpdb->prepare("DELETE FROM ".NINJA_FORMS_FAV_FIELDS_TABLE_NAME." WHERE id = %d", $fav_id), ARRAY_A);
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
function ninja_forms_get_all_favs(){
[144] Fix | Delete
global $wpdb;
[145] Fix | Delete
$fav_results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FAV_FIELDS_TABLE_NAME." WHERE row_type = %d ORDER BY name ASC", 1), ARRAY_A);
[146] Fix | Delete
if(is_array($fav_results) AND !empty($fav_results)){
[147] Fix | Delete
$x = 0;
[148] Fix | Delete
$count = count($fav_results) - 1;
[149] Fix | Delete
while($x <= $count){
[150] Fix | Delete
$fav_results[$x]['data'] = unserialize($fav_results[$x]['data']);
[151] Fix | Delete
$x++;
[152] Fix | Delete
}
[153] Fix | Delete
}
[154] Fix | Delete
return $fav_results;
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
// Begin Defined Fields Functions
[158] Fix | Delete
[159] Fix | Delete
function ninja_forms_get_def_by_id($def_id){
[160] Fix | Delete
global $wpdb;
[161] Fix | Delete
$def_row = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FAV_FIELDS_TABLE_NAME." WHERE id = %d", $def_id), ARRAY_A);
[162] Fix | Delete
$def_row['data'] = unserialize($def_row['data']);
[163] Fix | Delete
return $def_row;
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
function ninja_forms_get_all_defs(){
[167] Fix | Delete
global $wpdb;
[168] Fix | Delete
$def_results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FAV_FIELDS_TABLE_NAME." WHERE row_type = %d", 0), ARRAY_A);
[169] Fix | Delete
if(is_array($def_results) AND !empty($def_results)){
[170] Fix | Delete
$x = 0;
[171] Fix | Delete
$count = count($def_results) - 1;
[172] Fix | Delete
while($x <= $count){
[173] Fix | Delete
$def_results[$x]['data'] = unserialize($def_results[$x]['data']);
[174] Fix | Delete
$x++;
[175] Fix | Delete
}
[176] Fix | Delete
}
[177] Fix | Delete
return $def_results;
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
function ninja_forms_addslashes_deep( $value ){
[181] Fix | Delete
$value = is_array($value) ?
[182] Fix | Delete
array_map('ninja_forms_addslashes_deep', $value) :
[183] Fix | Delete
addslashes($value);
[184] Fix | Delete
return $value;
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
function utf8_encode_recursive( $input ){
[188] Fix | Delete
if ( is_array( $input ) ) {
[189] Fix | Delete
return array_map( __FUNCTION__, $input );
[190] Fix | Delete
}else{
[191] Fix | Delete
return utf8_encode( $input );
[192] Fix | Delete
}
[193] Fix | Delete
}
[194] Fix | Delete
[195] Fix | Delete
function ninja_forms_str_replace_deep($search, $replace, $subject){
[196] Fix | Delete
if( is_array( $subject ) ){
[197] Fix | Delete
foreach( $subject as &$oneSubject )
[198] Fix | Delete
$oneSubject = ninja_forms_str_replace_deep($search, $replace, $oneSubject);
[199] Fix | Delete
unset($oneSubject);
[200] Fix | Delete
return $subject;
[201] Fix | Delete
} else {
[202] Fix | Delete
return str_replace($search, $replace, $subject);
[203] Fix | Delete
}
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
function ninja_forms_html_entity_decode_deep( $value, $flag = ENT_COMPAT ){
[207] Fix | Delete
$value = is_array($value) ?
[208] Fix | Delete
array_map('ninja_forms_html_entity_decode_deep', $value) :
[209] Fix | Delete
html_entity_decode( $value, $flag );
[210] Fix | Delete
return $value;
[211] Fix | Delete
}
[212] Fix | Delete
[213] Fix | Delete
function ninja_forms_htmlspecialchars_deep( $value ){
[214] Fix | Delete
$value = is_array($value) ?
[215] Fix | Delete
array_map('ninja_forms_htmlspecialchars_deep', $value) :
[216] Fix | Delete
htmlspecialchars( $value );
[217] Fix | Delete
return $value;
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
function ninja_forms_stripslashes_deep( $value ){
[221] Fix | Delete
$value = is_array($value) ?
[222] Fix | Delete
array_map('ninja_forms_stripslashes_deep', $value) :
[223] Fix | Delete
stripslashes($value);
[224] Fix | Delete
return $value;
[225] Fix | Delete
}
[226] Fix | Delete
[227] Fix | Delete
function ninja_forms_esc_html_deep( $value ){
[228] Fix | Delete
$value = is_array($value) ?
[229] Fix | Delete
array_map('ninja_forms_esc_html_deep', $value) :
[230] Fix | Delete
esc_html($value);
[231] Fix | Delete
return $value;
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
function nf_wp_kses_post_deep( $value ){
[235] Fix | Delete
$value = is_array( $value ) ?
[236] Fix | Delete
array_map( 'nf_wp_kses_post_deep', $value ) :
[237] Fix | Delete
wp_kses_post($value);
[238] Fix | Delete
[239] Fix | Delete
return $value;
[240] Fix | Delete
}
[241] Fix | Delete
[242] Fix | Delete
function ninja_forms_strip_tags_deep($value ){
[243] Fix | Delete
$value = is_array($value) ?
[244] Fix | Delete
array_map('ninja_forms_strip_tags_deep', $value) :
[245] Fix | Delete
strip_tags($value);
[246] Fix | Delete
return $value;
[247] Fix | Delete
}
[248] Fix | Delete
[249] Fix | Delete
function ninja_forms_json_response(){
[250] Fix | Delete
global $ninja_forms_processing;
[251] Fix | Delete
[252] Fix | Delete
$form_id = $ninja_forms_processing->get_form_ID();
[253] Fix | Delete
[254] Fix | Delete
$errors = $ninja_forms_processing->get_all_errors();
[255] Fix | Delete
$success = $ninja_forms_processing->get_all_success_msgs();
[256] Fix | Delete
$fields = $ninja_forms_processing->get_all_fields();
[257] Fix | Delete
$form_settings = $ninja_forms_processing->get_all_form_settings();
[258] Fix | Delete
$extras = $ninja_forms_processing->get_all_extras();
[259] Fix | Delete
[260] Fix | Delete
// Success will default to false if there is not success message.
[261] Fix | Delete
if ( ! $success && ! $errors ) $success = true;
[262] Fix | Delete
[263] Fix | Delete
if( version_compare( phpversion(), '5.3', '>=' ) ){
[264] Fix | Delete
$json = json_encode( array( 'form_id' => $form_id, 'errors' => $errors, 'success' => $success, 'fields' => $fields, 'form_settings' => $form_settings, 'extras' => $extras ), JSON_HEX_QUOT | JSON_HEX_TAG );
[265] Fix | Delete
}else{
[266] Fix | Delete
[267] Fix | Delete
[268] Fix | Delete
$errors = ninja_forms_html_entity_decode_deep( $errors );
[269] Fix | Delete
$success = ninja_forms_html_entity_decode_deep( $success );
[270] Fix | Delete
$fields = ninja_forms_html_entity_decode_deep( $fields );
[271] Fix | Delete
$form_settings = ninja_forms_html_entity_decode_deep( $form_settings );
[272] Fix | Delete
$extras = ninja_forms_html_entity_decode_deep( $extras );
[273] Fix | Delete
[274] Fix | Delete
$errors = utf8_encode_recursive( $errors );
[275] Fix | Delete
$success = utf8_encode_recursive( $success );
[276] Fix | Delete
$fields = utf8_encode_recursive( $fields );
[277] Fix | Delete
$form_settings = utf8_encode_recursive( $form_settings );
[278] Fix | Delete
$extras = utf8_encode_recursive( $extras );
[279] Fix | Delete
[280] Fix | Delete
$errors = ninja_forms_str_replace_deep( '"', "\u0022", $errors );
[281] Fix | Delete
$errors = ninja_forms_str_replace_deep( "'", "\u0027", $errors );
[282] Fix | Delete
$errors = ninja_forms_str_replace_deep( '<', "\u003C", $errors );
[283] Fix | Delete
$errors = ninja_forms_str_replace_deep( '>', "\u003E", $errors );
[284] Fix | Delete
[285] Fix | Delete
$success = ninja_forms_str_replace_deep( '"', "\u0022", $success );
[286] Fix | Delete
$success = ninja_forms_str_replace_deep( "'", "\u0027", $success );
[287] Fix | Delete
$success = ninja_forms_str_replace_deep( '<', "\u003C", $success );
[288] Fix | Delete
$success = ninja_forms_str_replace_deep( '>', "\u003E", $success );
[289] Fix | Delete
[290] Fix | Delete
$fields = ninja_forms_str_replace_deep( '"', "\u0022", $fields );
[291] Fix | Delete
$fields = ninja_forms_str_replace_deep( "'", "\u0027", $fields );
[292] Fix | Delete
$fields = ninja_forms_str_replace_deep( '<', "\u003C", $fields );
[293] Fix | Delete
$fields = ninja_forms_str_replace_deep( '>', "\u003E", $fields );
[294] Fix | Delete
[295] Fix | Delete
$form_settings = ninja_forms_str_replace_deep( '"', "\u0022", $form_settings );
[296] Fix | Delete
$form_settings = ninja_forms_str_replace_deep( "'", "\u0027", $form_settings );
[297] Fix | Delete
$form_settings = ninja_forms_str_replace_deep( '<', "\u003C", $form_settings );
[298] Fix | Delete
$form_settings = ninja_forms_str_replace_deep( '>', "\u003E", $form_settings );
[299] Fix | Delete
[300] Fix | Delete
$extras = ninja_forms_str_replace_deep( '"', "\u0022", $extras );
[301] Fix | Delete
$extras = ninja_forms_str_replace_deep( "'", "\u0027", $extras );
[302] Fix | Delete
$extras = ninja_forms_str_replace_deep( '<', "\u003C", $extras );
[303] Fix | Delete
$extras = ninja_forms_str_replace_deep( '>', "\u003E", $extras );
[304] Fix | Delete
[305] Fix | Delete
$json = json_encode( array( 'form_id' => $form_id, 'errors' => $errors, 'success' => $success, 'fields' => $fields, 'form_settings' => $form_settings, 'extras' => $extras ) );
[306] Fix | Delete
$json = str_replace( "\\\u0022", "\\u0022", $json );
[307] Fix | Delete
$json = str_replace( "\\\u0027", "\\u0027", $json );
[308] Fix | Delete
$json = str_replace( "\\\u003C", "\\u003C", $json );
[309] Fix | Delete
$json = str_replace( "\\\u003E", "\\u003E", $json );
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
return $json;
[313] Fix | Delete
}
[314] Fix | Delete
[315] Fix | Delete
/*
[316] Fix | Delete
*
[317] Fix | Delete
* Function that sets up our transient variable.
[318] Fix | Delete
*
[319] Fix | Delete
* @since 2.2.45
[320] Fix | Delete
* @return void
[321] Fix | Delete
*/
[322] Fix | Delete
[323] Fix | Delete
function ninja_forms_set_transient(){
[324] Fix | Delete
global $ninja_forms_processing;
[325] Fix | Delete
[326] Fix | Delete
$form_id = $ninja_forms_processing->get_form_ID();
[327] Fix | Delete
[328] Fix | Delete
// Setup our transient variable.
[329] Fix | Delete
$cache = array();
[330] Fix | Delete
$cache['form_id'] = $form_id;
[331] Fix | Delete
$cache['field_values'] = $ninja_forms_processing->get_all_fields();
[332] Fix | Delete
$cache['form_settings'] = $ninja_forms_processing->get_all_form_settings();
[333] Fix | Delete
$cache['extra_values'] = $ninja_forms_processing->get_all_extras();
[334] Fix | Delete
$all_fields_settings = array();
[335] Fix | Delete
if ( $ninja_forms_processing->get_all_fields() ) {
[336] Fix | Delete
foreach ( $ninja_forms_processing->get_all_fields() as $field_id => $user_value ) {
[337] Fix | Delete
$field_settings = $ninja_forms_processing->get_field_settings( $field_id );
[338] Fix | Delete
$all_fields_settings[$field_id] = $field_settings;
[339] Fix | Delete
}
[340] Fix | Delete
}
[341] Fix | Delete
[342] Fix | Delete
$cache['field_settings'] = $all_fields_settings;
[343] Fix | Delete
[344] Fix | Delete
// Set errors and success messages as Ninja_Forms()->session variables.
[345] Fix | Delete
$success = $ninja_forms_processing->get_all_success_msgs();
[346] Fix | Delete
$errors = $ninja_forms_processing->get_all_errors();
[347] Fix | Delete
[348] Fix | Delete
$cache['success_msgs'] = $success;
[349] Fix | Delete
$cache['error_msgs'] = $errors;
[350] Fix | Delete
[351] Fix | Delete
Ninja_Forms()->session->set( 'nf_cache', $cache );
[352] Fix | Delete
}
[353] Fix | Delete
[354] Fix | Delete
/*
[355] Fix | Delete
*
[356] Fix | Delete
* Function that deletes our cache variable
[357] Fix | Delete
*
[358] Fix | Delete
* @since 2.2.45
[359] Fix | Delete
* @return void
[360] Fix | Delete
*/
[361] Fix | Delete
[362] Fix | Delete
function ninja_forms_delete_transient(){
[363] Fix | Delete
Ninja_Forms()->session->delete();
[364] Fix | Delete
}
[365] Fix | Delete
[366] Fix | Delete
/**
[367] Fix | Delete
* Get a count of submissions for a form
[368] Fix | Delete
*
[369] Fix | Delete
* @since 2.7
[370] Fix | Delete
* @param int $post_id
[371] Fix | Delete
* @return int $count
[372] Fix | Delete
*/
[373] Fix | Delete
function nf_get_sub_count( $form_id, $post_status = 'publish' ) {
[374] Fix | Delete
global $wpdb;
[375] Fix | Delete
[376] Fix | Delete
$meta_key = '_form_id';
[377] Fix | Delete
$meta_value = $form_id;
[378] Fix | Delete
[379] Fix | Delete
$sql = "SELECT count(DISTINCT pm.post_id)
[380] Fix | Delete
FROM $wpdb->postmeta pm
[381] Fix | Delete
JOIN $wpdb->posts p ON (p.ID = pm.post_id)
[382] Fix | Delete
WHERE pm.meta_key = %s
[383] Fix | Delete
AND pm.meta_value = %s
[384] Fix | Delete
AND p.post_type = 'nf_sub'
[385] Fix | Delete
AND p.post_status = %s";
[386] Fix | Delete
[387] Fix | Delete
$count = $wpdb->get_var( $wpdb->prepare( $sql, $meta_key, $meta_value, $post_status ) );
[388] Fix | Delete
[389] Fix | Delete
return $count;
[390] Fix | Delete
}
[391] Fix | Delete
[392] Fix | Delete
/**
[393] Fix | Delete
* Get an array of our fields by form ID.
[394] Fix | Delete
* The returned array has the field_ID as the key.
[395] Fix | Delete
*
[396] Fix | Delete
* @since 2.7
[397] Fix | Delete
* @param int $form_id
[398] Fix | Delete
* @return array $tmp_array
[399] Fix | Delete
*/
[400] Fix | Delete
function nf_get_fields_by_form_id( $form_id, $orderby = 'ORDER BY `order` ASC' ){
[401] Fix | Delete
global $wpdb;
[402] Fix | Delete
[403] Fix | Delete
$tmp_array = array();
[404] Fix | Delete
$field_results = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".NINJA_FORMS_FIELDS_TABLE_NAME." WHERE form_id = %d ".$orderby, $form_id), ARRAY_A);
[405] Fix | Delete
if ( is_array( $field_results ) && ! empty( $field_results ) ) {
[406] Fix | Delete
foreach ( $field_results as $field ) {
[407] Fix | Delete
$field_id = $field['id'];
[408] Fix | Delete
$field['data'] = unserialize( $field['data'] );
[409] Fix | Delete
$tmp_array[ $field_id ] = $field;
[410] Fix | Delete
}
[411] Fix | Delete
}
[412] Fix | Delete
[413] Fix | Delete
return $tmp_array;
[414] Fix | Delete
}
[415] Fix | Delete
[416] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function