Quantcast
Channel: Katz Web Services » WordPress
Viewing all articles
Browse latest Browse all 17

Generate a Link to Activate a Plugin in WordPress

$
0
0

Here’s another specialized plugin development tip!

If you want to create a link to activate a plugin, you need to know the path of the plugin file. Let’s use Akismet for this example.

$path = 'akismet/akismet.php';
$link = wp_nonce_url(admin_url('plugins.php?action=activate&plugin='.$path), 'activate-plugin_'.$path);

The $link URL will be something like http://yoursite.com/wp-admin/plugins.php?action=activate&plugin=akismet%2Fakismet.php&_wpnonce=f97dabdf9

The post Generate a Link to Activate a Plugin in WordPress appeared first on KWS Blog.


Viewing all articles
Browse latest Browse all 17

Trending Articles