diff --git a/CHANGELOG.md b/CHANGELOG.md index ea6ef3c..e68794b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/package.json b/package.json index 39e007c..4ba2cc5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -70,4 +70,4 @@ "block", "editor" ] -} \ No newline at end of file +} diff --git a/readme.txt b/readme.txt index 4e8327a..4db8809 100644 --- a/readme.txt +++ b/readme.txt @@ -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 @@ -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. diff --git a/search-replace-for-block-editor.php b/search-replace-for-block-editor.php index 2cd0563..d577c95 100644 --- a/search-replace-for-block-editor.php +++ b/search-replace-for-block-editor.php @@ -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 diff --git a/src/core/app.tsx b/src/core/app.tsx index 801af19..2e18803 100644 --- a/src/core/app.tsx +++ b/src/core/app.tsx @@ -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 ); /** @@ -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( '' ); } }; diff --git a/src/core/filters.tsx b/src/core/filters.tsx index cfe03f9..cf4df9c 100644 --- a/src/core/filters.tsx +++ b/src/core/filters.tsx @@ -33,7 +33,10 @@ addAction( break; case 'core/table': + replaceBlockAttribute( args, 'head' ); replaceBlockAttribute( args, 'body' ); + replaceBlockAttribute( args, 'foot' ); + replaceBlockAttribute( args, 'caption' ); break; default: