Skip to content

Add CSV Format search/replace to Search & Replace Tab#82

Merged
bueltge merged 5 commits into
wp-media:csv-formatfrom
BrysonZimmerman:master
Jun 15, 2017
Merged

Add CSV Format search/replace to Search & Replace Tab#82
bueltge merged 5 commits into
wp-media:csv-formatfrom
BrysonZimmerman:master

Conversation

@BrysonZimmerman

Copy link
Copy Markdown

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.

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.
@BrysonZimmerman

Copy link
Copy Markdown
Author

@devbanana Do you have thoughts on this pull request? I'd like to fix issues if they exist.

@bueltge bueltge left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread inc/Database/Exporter.php
//check if we need to replace something
//skip primary_key
if ( $search !== '' && $column !== $primary_key ) {
if ( $search !== '' && $column !== $primary_key && $column !== "guid") {

Copy link
Copy Markdown
Contributor

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.

Comment thread inc/Database/Exporter.php
$value
);

if($csv != null) {

Copy link
Copy Markdown
Contributor

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 ==.

@bueltge bueltge added this to the 3.2.0 milestone Jun 15, 2017
@bueltge bueltge modified the milestones: 3.1.3, 3.2.0 Jun 15, 2017
@bueltge bueltge changed the base branch from master to csv-format June 15, 2017 17:50
@bueltge bueltge merged commit afc7553 into wp-media:csv-format Jun 15, 2017
@bueltge

bueltge commented Jun 15, 2017

Copy link
Copy Markdown
Contributor

I merge this pull request in a new branch to fix the formatting issues.

bueltge added a commit that referenced this pull request Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants