obstschale / bookmark-manager

WordPress plugin for managing bookmarks
GNU General Public License v2.0
17 stars 1 forks source link

Save tags from bookmarklet #14

Closed obstschale closed 6 years ago

obstschale commented 7 years ago

The field for tags is already available within the bookmarklet. But the REST call does not set the IDs for tags, yet.

obstschale commented 6 years ago

With the new design I added the functionality to add tags from the bookmarklet.

This is quick'n'dirty implementation and I will refactor that, when I add the REST Controller. The feature works now as follows:

If a new tag is entered a REST call is send to WP to look if a tag exists with the slug (generated from the entered string). If the tag exists get the ID. If no tag exists the tag will be created.

Good thing: It works. Bad thing: For each new entered tag either 1 or 2 REST calls are placed. And a new tag is created instantly. Even then the tag is removed afterward from the list, the tag is still present in WP.

With a custom REST Controller, I will send only one call with the tags as strings, and the controller fetches the IDs or creates the tag.