diff --git a/plugin-name/class-plugin-name.php b/plugin-name/class-plugin-name.php index 8d6111a..8ba0b4d 100644 --- a/plugin-name/class-plugin-name.php +++ b/plugin-name/class-plugin-name.php @@ -79,6 +79,10 @@ class Plugin_Name { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + // Add an sction link pointing to th e optionspage. TODO: Rename "plugin-name.php" to the name your plugin + // $plugin_basename = plugin_basename( plugin_dir_path( __FILE__ ) . 'plugin-name.php' ); + // add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) ); + // Define custom functionality. Read more about actions and filters: http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters add_action( 'TODO', array( $this, 'action_method_name' ) ); add_filter( 'TODO', array( $this, 'filter_method_name' ) ); @@ -229,6 +233,22 @@ class Plugin_Name { include_once( 'views/admin.php' ); } + /* + * Add settings action link to the plugins page. + * + * @since 1.0.0 + */ + public function add_action_links( $links ) { + + return array_merge( + array( + 'settings' => '' . __( 'Settings', $this->plugin_slug ) . '' + ), + $links + ); + + } + /** * NOTE: Actions are points in the execution of a page or process * lifecycle that WordPress fires. @@ -255,4 +275,4 @@ class Plugin_Name { // TODO: Define your filter hook callback here } -} \ No newline at end of file +}