WordPress.org

Plugin Directory

Changeset 608708


Ignore:
Timestamp:
10/05/12 21:48:17 (19 months ago)
Author:
aaroncampbell
Message:

Add link to settings page in plugin row on plugins page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-google-analytics/trunk/wp-google-analytics.php

    r608688 r608708  
    5656        add_action( 'get_footer',               array( $this, 'insert_code' ) ); 
    5757        add_action( 'wp_enqueue_scripts',       array( $this, 'track_outgoing' ) ); 
     58        add_filter( 'plugin_action_links',      array( $this, 'add_plugin_page_links' ), 10, 2 ); 
    5859    } 
    5960 
     
    569570    } 
    570571 
     572    public function add_plugin_page_links( $links, $file ){ 
     573        if ( plugin_basename( __FILE__ ) == $file ) { 
     574            $link = '<a href="' . admin_url( 'options-general.php?page=' . self::$page_slug ) . '">' . __( 'Settings', 'wp-google-analytics' ) . '</a>'; 
     575            array_unshift( $links, $link ); 
     576        } 
     577        return $links; 
     578    } 
     579 
    571580} 
    572581 
Note: See TracChangeset for help on using the changeset viewer.