I need to be able to have a charvar field that contains an apostrophe like Woody's. I'm using wp_list_table to simplify the editing of the table. After making the update, the field contains Woody/'s. I can update the data using phpMyAdmin by using Woody''s. Thought that before the data is sent to wp_list_table I could change it to Woody''s, but that ends up in the database as Woody/'/'s. How do I accomplish this?
I need to be able to have a charvar field that contains an apostrophe like Woody's. I'm using wp_list_table to simplify the editing of the table. After making the update, the field contains Woody/'s. I can update the data using phpMyAdmin by using Woody''s. Thought that before the data is sent to wp_list_table I could change it to Woody''s, but that ends up in the database as Woody/'/'s. How do I accomplish this?
Share Improve this question asked Sep 9, 2019 at 16:56 BudBud 438 bronze badges 1- There's no code in your question, can you edit it to include code? – Tom J Nowell ♦ Commented Sep 9, 2019 at 17:13
1 Answer
Reset to default -1Apparently someplace in the wp_list_table, or maybe someplace else, the escape character \ was inserted before any ' . I was able to solve this by adding this line of code just before the $wpdb->update statement.
$item['RecordedSubdivision'] = str_replace("\'", "'",$item['RecordedSubdivision']);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745172188a4614994.html
评论列表(0条)