diff --git a/README.md b/README.md index b358b1f..97cfcf6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** comments, mention, email, user, bbpress **Requires at least:** 4.6 **Tested up to:** 6.6.2 -**Stable tag:** 1.7.12 +**Stable tag:** 1.7.13 **Requires PHP:** 5.6 **License:** GPLv2 or later **License URI:** https://www.gnu.org/licenses/gpl-2.0.html @@ -31,7 +31,7 @@ https://www.youtube.com/watch?v=Nz47aKJhsKQ * Search by Display name while mention. * Enable mentioning on Page comment. * Added option to Turn off Email notification. -* Mention by First Name & Last Name. +* Mention by First Name & Last Name ( Under development... ). * Go to wp-admin –> Comment Mention * And you will see options to enable pro features https://prnt.sc/r5W2X4utYe3v @@ -63,6 +63,9 @@ e.g. ## Changelog ## +### 1.7.13 ### +* Mention script improvisation for pro plugin. + ### 1.7.12 ### * Mention script improvisation. diff --git a/comment-mention.php b/comment-mention.php index 605125d..a1a4cc2 100644 --- a/comment-mention.php +++ b/comment-mention.php @@ -6,7 +6,7 @@ * Author URI: https://bhargavb.com * Text Domain: comment-mention * Domain Path: /languages - * Version: 1.7.12 + * Version: 1.7.13 * * @package Comment_Mention */ @@ -21,7 +21,7 @@ /** * The version of the plugin. */ - define( 'CMT_MNTN_VERSION', '1.7.12' ); + define( 'CMT_MNTN_VERSION', '1.7.13' ); } if ( ! defined( 'CMT_MNTN_PATH' ) ) { /** diff --git a/readme.txt b/readme.txt index 71984b3..52ea30f 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BnB90/50 Tags: comments, mention, email, user, bbpress Requires at least: 4.6 Tested up to: 6.6.2 -Stable tag: 1.7.12 +Stable tag: 1.7.13 Requires PHP: 5.6 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -31,7 +31,7 @@ https://www.youtube.com/watch?v=Nz47aKJhsKQ * Search by Display name while mention. * Enable mentioning on Page comment. * Added option to Turn off Email notification. -* Mention by First Name & Last Name. +* Mention by First Name & Last Name ( Under development... ). * Go to wp-admin –> Comment Mention * And you will see options to enable pro features https://prnt.sc/r5W2X4utYe3v @@ -63,6 +63,9 @@ e.g. == Changelog == += 1.7.13 = +* Mention script improvisation for pro plugin. + = 1.7.12 = * Mention script improvisation. diff --git a/src/js/tribute-config.js b/src/js/tribute-config.js index cab1b94..1c7b7f2 100644 --- a/src/js/tribute-config.js +++ b/src/js/tribute-config.js @@ -71,9 +71,17 @@ jQuery( let content = $( '#comment' ).val(); + let already_mentioned = localStorage.getItem('mentionMap'); + + if ( '' !== already_mentioned ) { + already_mentioned = JSON.parse(already_mentioned); + $.each(already_mentioned, function(key, value) { + mentionMap[key] = value; + }); + } + Object.keys( mentionMap ).forEach( name => { - const nameMention = '@' + mentionMap[name]; // Mention format in textarea1 (name) const usernameMention = '@' + name; // Mention format in textarea2 (username) content = content.split( nameMention ).join( usernameMention );