Skip to content

Commit

Permalink
Merge pull request #1542 from xwp/feature/1539-leave-feedback-notice
Browse files Browse the repository at this point in the history
Display feature request notice on Settings screen
  • Loading branch information
delawski authored Aug 5, 2024
2 parents 00d2ad8 + caa186a commit 6fb532a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions classes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public function __construct( $plugin ) {
add_action( 'admin_notices', array( $this, 'prepare_admin_notices' ) );
add_action( 'shutdown', array( $this, 'admin_notices' ) );

// Feature request notice.
add_action( 'admin_notices', array( $this, 'display_feature_request_notice' ) );

// Add admin body class.
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );

Expand Down Expand Up @@ -302,6 +305,26 @@ public function admin_notices() {
}
}

/**
* Display a feature request notice.
*
* @return void
*/
public function display_feature_request_notice() {
$screen = get_current_screen();

// Display the notice only on the Stream settings page.
if ( empty( $this->screen_id['settings'] ) || $this->screen_id['settings'] !== $screen->id ) {
return;
}

printf(
'<div class="notice notice-info notice-stream-feature-request"><p>%1$s <a href="https://github.com/xwp/stream/issues/new/choose" target="_blank">%2$s <span class="dashicons dashicons-external"></span></a></p></div>',
esc_html__( 'Have suggestions or found a bug?', 'stream' ),
esc_html__( 'Click here to let us know!', 'stream' )
);
}

/**
* Register menu page
*
Expand Down
5 changes: 5 additions & 0 deletions ui/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ more custom columns squeezes the summary column to a narrow strip.

/* Settings */

.notice-stream-feature-request .dashicons {
font-size: 17px;
text-decoration: none;
}

.wp_stream_settings .select2.select2-container,
.wp_stream_network_settings .select2.select2-container,
.wp_stream_default_settings .select2.select2-container {
Expand Down

0 comments on commit 6fb532a

Please sign in to comment.