jimboobrien
9/20/2017 - 11:33 PM

Add a settings link to your WordPress plugin

Add a settings link to your WordPress plugin

<?php

/**
 * Add a settings link to your WordPress plugin on the plugin listing page.
 */
function add_settings_link( $links, $file ){
    if( $file == plugin_basename(__FILE__) ){
        $settings_link = '<a href="'.admin_url('admin.php?page=my-page').'">'.__('Settings', $this->textdomain).'</a>';
        array_unshift( $links, $settings_link );
    }
    return $links;
}