diff --git a/includes/classes/Settings.php b/includes/classes/Settings.php index 3d275e6..fa4ac65 100644 --- a/includes/classes/Settings.php +++ b/includes/classes/Settings.php @@ -27,6 +27,9 @@ public function __construct() { add_filter( 'sanitize_option_' . SETTINGS_GROUP, array( $this, 'sanitize' ), 10, 2 ); add_action( 'admin_menu', array( $this, 'logs_menu' ) ); + + add_filter( 'plugin_action_links_' . SOPHI_DEBUG_BAR_PLUGIN, array( $this, 'action_links' ) ); + } /** @@ -244,4 +247,20 @@ public function sanitize( $value, $option ) { return $value; } + + /** + * Add setting page to plugin action links. + * + * @param array $actions Plugin actions. + * @return array + */ + public function action_links( $actions = array() ) { + $links = array( + '' . __( 'Settings', 'debug-bar-for-sophi' ) . '', + ); + + $actions = array_merge( $links, $actions ); + + return $actions; + } } diff --git a/sophi-debug-bar.php b/sophi-debug-bar.php index 2f994ff..89453b2 100755 --- a/sophi-debug-bar.php +++ b/sophi-debug-bar.php @@ -19,6 +19,7 @@ define( 'SOPHI_DEBUG_BAR_VERSION', '0.2.0' ); define( 'SOPHI_DEBUG_BAR_URL', plugin_dir_url( __FILE__ ) ); define( 'SOPHI_DEBUG_BAR_PATH', plugin_dir_path( __FILE__ ) ); +define( 'SOPHI_DEBUG_BAR_PLUGIN', plugin_basename( __FILE__ ) ); define( 'SOPHI_DEBUG_BAR_INC', SOPHI_DEBUG_BAR_PATH . 'includes/' ); $upload_dir = wp_upload_dir( null, false ); define( 'SOPHI_DEBUG_BAR_LOG_PATH', $upload_dir['basedir'] . '/sophi-logs' );