The "Save to Site" bookmarklet, revived through a plugin's external dependency#159
Merged
The "Save to Site" bookmarklet, revived through a plugin's external dependency#159
Conversation
…. 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.
…e to site button link.
joshdarby
approved these changes
May 14, 2019
| } | ||
|
|
||
| // since 4.9, get_shortcut_link has returned the empty string. | ||
| if ( empty( $shortcut_link ) && function_exists( 'press_this_get_shortcut_link' ) ) { |
There was a problem hiding this comment.
@benlk Do you think it'd be beneficial here to also make sure the WP version is greater than 4.9?
Collaborator
Author
There was a problem hiding this comment.
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.
network_admin_url should fall back to admin_url on non-multisites, according to https://developer.wordpress.org/reference/functions/network_admin_url/
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
If a site is not capable of creating the bookmarklet and the current user is capable of installing plugins:
If the site is not capable of creating the bookmarklet and the current user cannot install plugins:
If the site is capable of creating the bookmarklet, then the page's appearance is unchanged: