Skip to content

The "Save to Site" bookmarklet, revived through a plugin's external dependency#159

Merged
benlk merged 6 commits intodevelopfrom
130-press-to-save-renewed
May 15, 2019
Merged

The "Save to Site" bookmarklet, revived through a plugin's external dependency#159
benlk merged 6 commits intodevelopfrom
130-press-to-save-renewed

Conversation

@benlk
Copy link
Copy Markdown
Collaborator

@benlk benlk commented May 14, 2019

Changes

If a site is not capable of creating the bookmarklet and the current user is capable of installing plugins:

Screen Shot 2019-05-13 at 20 04 24

Save to Site is a tool that lets you send Saved Links to your WordPress Dashboard while browsing the web.

Your website is not currently capable of generating the link used for the Save to Site bookmarklet. In order to use the Save to Site bookmarklet, you will need to install the official WordPress plugin Press This, which reimplements functionality that was removed from WordPress in version 4.9.

If the site is not capable of creating the bookmarklet and the current user cannot install plugins:

Screen Shot 2019-05-13 at 20 35 13

If the site is capable of creating the bookmarklet, then the page's appearance is unchanged:

Screen Shot 2019-05-13 at 20 05 01

benlk added 3 commits May 13, 2019 17:34
…. Else, the shortcut link is the empty string.
… enable a WP core plugin

This page explains why the plugin is needed, and how to enable it.
}

// since 4.9, get_shortcut_link has returned the empty string.
if ( empty( $shortcut_link ) && function_exists( 'press_this_get_shortcut_link' ) ) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benlk Do you think it'd be beneficial here to also make sure the WP version is greater than 4.9?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary; we're less concerned about what version of WordPress is in use and more concerned about whether that version of WordPress provides the link. Checking the WordPress version is a way of getting a clue as to whether the link would be provided, but it's easier to just test whether the link is provided.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: #166

@benlk benlk merged commit 5d72f74 into develop May 15, 2019
@benlk benlk deleted the 130-press-to-save-renewed branch May 15, 2019 18:42
@benlk benlk mentioned this pull request May 20, 2019
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