WP Manifestindependent plugin directory
manifest / utilities / notice-shortcode-plugin

Notice Shortcode Plugin

A WordPress plugin that adds a customizable frontend notice using a shortcode.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/adityas62/notice-shortcode-plugin/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A simple WordPress plugin that adds a shortcode to display customizable notices on the frontend of a website.

This plugin is built to demonstrate WordPress fundamentals such as plugins, shortcodes, hooks, sanitization, and clean code structure.


Features

  • Adds a frontend shortcode to display notices
  • Supports custom messages via shortcode attributes
  • Uses WordPress best practices
  • Sanitizes output for security
  • Lightweight and beginner-friendly

Usage

After activating the plugin, use the shortcode inside any post or page:

[notice]

Custom Message Example

You can pass a custom message using an attribute:

[notice message="Welcome! This notice is generated using a shortcode."]


How It Works

  • The plugin registers a shortcode using add_shortcode()
  • The shortcode callback function returns HTML output
  • Default values are handled using shortcode_atts()
  • Output is sanitized using esc_html() for security
  • Basic styles are injected using the wp_head action hook

Security Practices

  • Prevents direct access using ABSPATH check
  • Escapes frontend output to avoid XSS attacks
  • Follows WordPress coding standards

📁 Plugin Structure

noticeSC/ ├── noticeSC.php └── README.md


Author

Aditya Kumar Singh


Notes

This plugin is created for learning and demonstration purposes and is suitable for beginner to intermediate WordPress developers.


License

This project is open-source and free to use for educational purposes.