Skip to content
Snippets Groups Projects
Commit bd9e1faa authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

fix: remove of the plugin_api filter as prohibited for use in the plugin review.

parent 08e34862
No related branches found
No related tags found
1 merge request!45fix: remove of the plugin_api filter as prohibited for use in the plugin review.
Pipeline #506445 passed with stages
in 21 seconds
...@@ -491,22 +491,6 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { ...@@ -491,22 +491,6 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
if ( function_exists( 'wp_nonce_url' ) && function_exists( 'wp_create_nonce' ) ) { if ( function_exists( 'wp_nonce_url' ) && function_exists( 'wp_create_nonce' ) ) {
$install_url = wp_nonce_url( $install_url, 'install-plugin_' . $slug ); $install_url = wp_nonce_url( $install_url, 'install-plugin_' . $slug );
} }
add_filter( 'plugins_api', function( $api, $action, $args ) use ( $plugin_info, $slug ) {
if ( 'plugin_information' !== $action ||
false !== $api ||
! isset( $args->slug ) ||
$slug !== $args->slug
) {
return $api;
}
$api = new stdClass();
$api->name = $plugin_info['nice_name']; // self in closures requires 5.4
$api->version = '';
$api->download_link = esc_url( $plugin_info['repository_url'] ); // self in closures requires 5.4
return $api;
}, 10, 3 );
return $install_url; return $install_url;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment