WordPress Add Custom Plugin Action Links – In this post we see how we can add custom action links to plugin on plugin page. When we create plugin to perform some actions , then sometimes we need to add more links to plugin actions for any task.
Let’s start with creating one test plugin –
<?php /* * Plugin Name: Plugin Custom Action * Description: Add custom action to plugin actions on plugin along with activate/deactivate, edit. * Author: Webkul * Author URI: https://webkul.com * Version: 1.0 */ ?>
The plugin will list in plugin page as seen below –
We will add our custom link e.g. Demo with Deactivate and Edit shown in above image –
<?php
/*
* Plugin Name: Plugin Custom Action
* Description: Add custom action to plugin actions on plugin along with activate/deactivate, edit.
* Author: Webkul
* Author URI: https://webkul.com
* Version: 1.0
* Text Domain: domain
*/
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'wk_plugin_settings_link' );
function wk_plugin_settings_link( $links )
{
$url = 'https://wordpressdemo.webkul.com';
$_link = '<a href="'.$url.'" target="_blank">' . __( 'Demo', 'domain' ) . '</a>';
$links[] = $_link;
return $links;
}
Using above code we added the custom link named Demo to plugin action links. We provide here some site url for example, which looks on plugin page as below –
In above image we can see that the demo link is displaying with default links. So, in this way we can add custom plugin action links to plugin on plugin page.
Support
For any kind of technical assistance, please raise a ticket or send us a mail at [email protected]
You may also check out our exclusive WooCommerce Addons and can also explore our WooCommerce Development Services.
Thanks for Your Time! Have a Good Day!


Be the first to comment.