Plugin Directory

Changeset 1151550


Ignore:
Timestamp:
05/02/2015 03:09:55 AM (11 years ago)
Author:
strider72
Message:

Updated Settings “action” link on Plugins page to use plugin-specific hook.

Location:
quiz/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quiz/trunk/quiz.php

    r1134170 r1151550  
    294294        if( current_user_can('manage_options') ) {
    295295            $page = add_options_page( __( 'Comment Quiz', 'quiz' ), __( 'Quiz', 'quiz' ), 'manage_options', 'quiz', array( $this, 'settings_page' ) );
    296             add_filter( 'plugin_action_links', array( $this, 'filter_plugin_actions' ), 10, 2 );
     296            add_filter( 'plugin_action_links_'.plugin_basename( __FILE__ ), array( $this, 'filter_plugin_actions' ) );
    297297            add_action( 'load-' . $page, array( $this, 'save_options' ) );
    298298            return $page;
     
    302302
    303303// Add action link(s) to plugins page
    304     function filter_plugin_actions( $links, $file ){
    305         //Static so we don't call plugin_basename on every plugin row.
    306         static $this_plugin;
    307         if( ! $this_plugin ) $this_plugin = plugin_basename( __FILE__ );
    308 
    309         if( $file == $this_plugin ){
    310             $settings_link = '<a href="' . $this->options_url() . '">' . __( 'Settings' ) . '</a>';
    311             array_unshift( $links, $settings_link );
    312         }
     304    function filter_plugin_actions( $links ){
     305        $settings_link = '<a href="' . $this->options_url() . '">' . __( 'Settings' ) . '</a>';
     306        array_unshift( $links, $settings_link );
    313307        return $links;
    314308    }
  • quiz/trunk/readme.txt

    r1134179 r1151550  
    4949
    5050== Changelog ==
     51
     52= 1.3.2 =
     53    * by SR
     54    * Improved hook for Settings link on Plugins page
    5155
    5256= 1.3.1 =
Note: See TracChangeset for help on using the changeset viewer.