Skip to content

Commit 0d3b318

Browse files
committed
Make sure plugin action links and admin notices are output
1 parent 3c05a48 commit 0d3b318

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

src/Admin.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,8 @@ class Admin {
3131
*/
3232
public function __construct() {
3333

34-
// add plugin page row action links
35-
add_filter( 'plugin_action_links_wp-php-console/wp-php-console.php', static function( $actions ) {
36-
return array_merge( [
37-
'<a href="' . esc_url( admin_url() ) . '">' . esc_html__( 'Settings', 'wp-php-console' ) . '</a>',
38-
'<a href="' . esc_url( Plugin::get_project_page_url() ) . '">' . esc_html__( 'GitHub', 'wp-php-console' ) . '</a>',
39-
'<a href="' . esc_url( Plugin::get_support_page_url() ) . '">' . esc_html__( 'Support', 'wp-php-console' ) . '</a>',
40-
'<a href="' . esc_url( Plugin::get_reviews_page_url() ) . '">' . esc_html__( 'Review', 'wp-php-console' ) . '</a>',
41-
], $actions );
42-
} );
34+
self::add_plugin_page_row_action_links();
35+
self::output_admin_notices();
4336

4437
// init settings page
4538
if ( ! defined( 'DOING_AJAX' ) ) {
@@ -74,4 +67,22 @@ private static function output_admin_notices() {
7467
}
7568

7669

70+
/**
71+
* Adds plugin page row action links.
72+
*
73+
* @since 1.6.0
74+
*/
75+
private static function add_plugin_page_row_action_links() {
76+
77+
add_filter( 'plugin_action_links_wp-php-console/wp-php-console.php', static function( $actions ) {
78+
return array_merge( [
79+
'<a href="' . esc_url( admin_url() ) . '">' . esc_html__( 'Settings', 'wp-php-console' ) . '</a>',
80+
'<a href="' . esc_url( Plugin::get_project_page_url() ) . '">' . esc_html__( 'GitHub', 'wp-php-console' ) . '</a>',
81+
'<a href="' . esc_url( Plugin::get_support_page_url() ) . '">' . esc_html__( 'Support', 'wp-php-console' ) . '</a>',
82+
'<a href="' . esc_url( Plugin::get_reviews_page_url() ) . '">' . esc_html__( 'Review', 'wp-php-console' ) . '</a>',
83+
], $actions );
84+
} );
85+
}
86+
87+
7788
}

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public static function get_php_console_project_page_url() {
345345
*
346346
* @since 1.6.0
347347
*
348-
* @return string;
348+
* @return string
349349
*/
350350
public static function get_php_console_chrome_extension_url() {
351351

0 commit comments

Comments
 (0)