Plugin Directory

Changeset 2034484


Ignore:
Timestamp:
02/19/2019 08:39:12 PM (7 years ago)
Author:
ShopSite
Message:

Add link to the settings on the plugins admin page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shopsite-plugin/trunk/shopsite.php

    r2010699 r2034484  
    112112add_shortcode( 'product', 'product_handler' );
    113113add_shortcode( 'ss_product', 'product_handler' );
     114add_filter('plugin_action_links', 'add_shopsite_settings_link', 10, 2);
     115
     116function add_shopsite_settings_link($links, $file) {
     117  if($file === plugin_basename(__FILE__)) {
     118    $links = (array) $links;
     119    $links[] = '<a href="'.admin_url('options-general.php?page=shopsite_menu').'">Settings</a>';
     120  }
     121  return $links;
     122}
    114123
    115124function add_shopsite_menu() {
Note: See TracChangeset for help on using the changeset viewer.