Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display feature request notice on Settings screen #1542

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading