Skip to content

AdityaS62/notice-shortcode-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

Notice Shortcode Plugin

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages