Created
November 16, 2016 12:26
-
-
Save ajitbohra/215aaea0ea3d931797499f4b0dc858c8 to your computer and use it in GitHub Desktop.
Wordpress generate plugin install URL
This file contains 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
<?php | |
/** | |
* http://stackoverflow.com/questions/5327920/how-to-generate-a-wordpress-plugin-install-link | |
**/ | |
$action = 'install-plugin'; | |
$slug = 'akismet'; | |
wp_nonce_url( | |
add_query_arg( | |
array( | |
'action' => $action, | |
'plugin' => $slug | |
), | |
admin_url( 'update.php' ) | |
), | |
$action.'_'.$slug | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment