Reading list Switch to dark mode

    WordPress Add Custom Plugin Action Links

    Updated 25 August 2017

    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 –

    WordPress Add Custom Plugin Action Links

    We will add our custom link e.g. Demo with Deactivate and Edit shown in above image –

    Searching for an experienced
    WordPress Company ?
    Find out More
    <?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 –

    WordPress Add Custom Plugin Action Links

    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

    Still have any issue feel free to add a ticket and let us know your views to make the code better https://webkul.uvdesk.com/en/customer/create-ticket/

    Thanks for Your Time! Have a Good Day!

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home

    Table of Content