https://github.com/badasswp/display-site-notification-bar
Display a notice bar on your WP home page.
https://github.com/badasswp/display-site-notification-bar
bar notice plugin wordpress
Last synced: 5 months ago
JSON representation
Display a notice bar on your WP home page.
- Host: GitHub
- URL: https://github.com/badasswp/display-site-notification-bar
- Owner: badasswp
- License: gpl-3.0
- Created: 2025-07-08T22:42:33.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-09-27T09:48:29.000Z (9 months ago)
- Last Synced: 2025-10-30T01:44:44.870Z (8 months ago)
- Topics: bar, notice, plugin, wordpress
- Language: PHP
- Homepage:
- Size: 1.16 MB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# display-site-notification-bar
Display a notice bar on your WP home page.

## Why Display Site Notification Bar?
This plugin makes it super easy to display a notifiction bar on the front-end. It also allows you to customize how the notification bar looks like.

### Hooks
#### `display_site_notification_bar_admin_fields`
This custom hook (filter) provides a way to filter the admin fields presented on the options page of the plugin.
```php
add_filter( 'display_site_notification_bar_admin_fields', [ $this, 'custom_admin_fields' ] );
public function custom_admin_fields( $fields ): array {
$fields[] = [
'name' => 'name_of_your_control',
'label' => __( 'Control Label', 'your-text-domain' ),
'cb' => [ $this, 'name_of_your_control_callback' ],
'page' => 'display-site-notification-bar',
'section' => 'site_notice_section',
];
return $fields;
}
```
**Parameters**
- fields _`{array}`_ By default this will be an array containing key, value options for the control.
#### `display_site_notification_bar_settings`
This custom hook (filter) provides a way to customise the settings used by the notification bar.
```php
add_filter( 'display_site_notification_bar_settings', [ $this, 'custom_bar_settings' ] );
public function bar_settings( $settings ): array {
$settings['site_notice_text'] = esc_html(
'Lorem ipsum doloar sit amet aquila siento'
);
return $settings;
}
```
**Parameters**
- settings _`{array}`_ By default this will be an associative array containing key, value options of the settings used by the notification bar on the front-end.
## Contribute
Contributions are __welcome__ and will be fully __credited__. To contribute, please fork this repo and raise a PR (Pull Request) against the `master` branch.
### Pre-requisites
You should have the following tools before proceeding to the next steps:
- Composer
- Yarn
- Docker
To enable you start development, please run:
```bash
yarn start
```
This should spin up a local WP env instance for you to work with at:
```bash
http://display-site-notification-bar.localhost:8484
```
You should now have a functioning local WP env to work with. To login to the `wp-admin` backend, please use `admin` for username & `password` for password.
__Awesome!__ - Thanks for being interested in contributing your time and code to this project!