Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.8.0
* Feat: Add Search & Replace feature for table head, foot & caption.
* Fix: Reset `Replace` input field.
* Tested up to WP 6.8.

## 1.7.0
* Fix: Issue with rich content replacement (HTML bearing string).
* Feat: On Modal open, show items found for Highlighted text.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search-and-replace",
"version": "1.7.0",
"version": "1.8.0",
"description": "Search and Replace text within the Block Editor.",
"author": "badasswp",
"license": "GPL-2.0-or-later",
Expand Down Expand Up @@ -70,4 +70,4 @@
"block",
"editor"
]
}
}
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: badasswp, rajanand346, jargovi
Tags: search, replace, text, block, editor.
Requires at least: 6.0
Tested up to: 6.8
Stable tag: 1.7.0
Stable tag: 1.8.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -63,6 +63,11 @@ Want to add your personal touch? All of our documentation can be found [here](ht

== Changelog ==

= 1.8.0 =
* Feat: Add Search & Replace feature for table head, foot & caption.
* Fix: Reset `Replace` input field.
* Tested up to WP 6.8.

= 1.7.0 =
* Fix: Issue with rich content replacement (HTML bearing string).
* Feat: On Modal open, show items found for Highlighted text.
Expand Down
2 changes: 1 addition & 1 deletion search-replace-for-block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Search and Replace for Block Editor
* Plugin URI: https://github.com/badasswp/search-and-replace
* Description: Search and Replace text within the Block Editor.
* Version: 1.7.0
* Version: 1.8.0
* Author: badasswp
* Author URI: https://github.com/badasswp
* License: GPL v2 or later
Expand Down
5 changes: 3 additions & 2 deletions src/core/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
const [ caseSensitive, setCaseSensitive ] = useState< boolean >( false );
const [ context, setContext ] = useState< boolean >( false );

// Reference to the first field inside the modal
// Reference to the first field inside the modal.
const searchFieldRef = useRef< HTMLInputElement | null >( null );

/**
Expand All @@ -58,10 +58,11 @@ const SearchReplaceForBlockEditor = (): JSX.Element => {
.getSelection()
.toString();

// By default, reset count and search input.
// By default, reset count, search & replace inputs.
if ( ! selectedText ) {
setReplacements( 0 );
setSearchInput( '' );
setReplaceInput( '' );
}
};

Expand Down
3 changes: 3 additions & 0 deletions src/core/filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ addAction(
break;

case 'core/table':
replaceBlockAttribute( args, 'head' );
replaceBlockAttribute( args, 'body' );
replaceBlockAttribute( args, 'foot' );
replaceBlockAttribute( args, 'caption' );
break;

default:
Expand Down