Implement REST controller for block directory features.#17243
Closed
ck-lee wants to merge 1 commit intoWordPress:masterfrom
Closed
Implement REST controller for block directory features.#17243ck-lee wants to merge 1 commit intoWordPress:masterfrom
ck-lee wants to merge 1 commit intoWordPress:masterfrom
Conversation
tellyworth
reviewed
Sep 11, 2019
| include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); | ||
| include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); | ||
|
|
||
| $api = plugins_api( |
Contributor
There was a problem hiding this comment.
We can probably simplify this function to remove the need to query the API, providing some assumptions are true:
If the uninstall_block() method is only ever used to uninstall blocks that were installed using the install_block() method, and the slug is the plugin slug (which means it's also the folder name), then we can skip more or less straight to the deactivate_plugins() step.
|
|
||
| include( ABSPATH . WPINC . '/version.php' ); | ||
|
|
||
| $url = 'http://api.wordpress.org/plugins/info/1.2/'; |
Contributor
There was a problem hiding this comment.
This should call plugins_api() instead of wp_remote_get().
Member
|
Closing in favour of #17431. |
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.
Description
This implements the REST controller required for the features to search, install and uninstall block for block directory features.
How has this been tested?
Tested locally
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
This PR is a split of #16524
Checklist: