-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CSV Format search/replace to Search & Replace Tab #82
Conversation
Created CSV entry in Search & Replace tab Pass csv data to replace_values function Note: Change counter will only increment on cells changed and not number of changes made in a cell Missing: Multilingual support
CSV label now uses esc_html_e function. Updated default to no longer include "(optional)" for improved readability. Still lacking translation to other langauges.
Per the important GUID note here: https://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note
@devbanana Do you have thoughts on this pull request? I'd like to fix issues if they exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devbanana THe codex of the source is wrong. I added two hints an two examples, maybe you will fix this and add this to the pull request? Thanks a lot for your effort.
@@ -327,13 +337,17 @@ public function backup_table( $search = '', $replace = '', $table, $new_table_pr | |||
//skip replace if no search pattern | |||
//check if we need to replace something | |||
//skip primary_key | |||
if ( $search !== '' && $column !== $primary_key ) { | |||
if ( $search !== '' && $column !== $primary_key && $column !== "guid") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always we use single quote mark, is much faster.
|
||
$edited_data = $this->replace->recursive_unserialize_replace( | ||
$search, $replace, | ||
$value | ||
); | ||
|
||
if($csv != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need whitespace, like in this example if ( $csv !== null ) {
and also a identical usage, strict !==
instead of ==
.
I merge this pull request in a new branch to fix the formatting issues. |
I've found myself in need of a bulk search/replace function for some time now to handle broken links that occur when importing a site from HTML to Wordpress. To that end, I've added a CSV option to the Search & Replace tab.
The CSV option's label is missing translations for German and Chinese.