WP Manifestindependent plugin directory
manifest / developer / my-plugin

My Plugin

Boilerplate starter plugin for WordPress - custom post type, REST API, and admin settings page stubs, ready to rename and extend.

by hiral26 · github.com/hiral262/my-plugin

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/hiral262/my-plugin/archive/refs/heads/main.zip

Boilerplate starter plugin for WordPress — a clean, WPCS-compliant scaffold to rename and build on top of.

Features

  • Custom post type stub (mp_item — "Items")
  • REST API endpoint stub — GET /wp-json/my-plugin/v1/items
  • Admin Settings page under the CPT menu, built with the WordPress Settings API
  • Activation / deactivation hooks (default options, rewrite flush)
  • uninstall.php cleanup handler that removes plugin options on delete
  • One class per responsibility under includes/, following WordPress Coding Standards

Requirements

  • WordPress 5.8+
  • PHP 7.4+

Installation

  1. Download or clone this repository into wp-content/plugins/my-plugin.
  2. Activate My Plugin from Plugins → Installed Plugins.
  3. Go to My Plugin → Settings to configure the example option.

Project structure

my-plugin/
├── my-plugin.php              # Main plugin file — headers, constants, hooks, bootstrap
├── uninstall.php               # Removes plugin options on uninstall
├── includes/
│   ├── class-post-type.php     # Registers the "Item" custom post type
│   ├── class-rest-api.php      # Registers the /my-plugin/v1/items REST route
│   └── class-admin-page.php    # Settings page (Settings API)
├── assets/
│   ├── admin.css
│   └── admin.js
└── languages/                  # .pot/.po/.mo translation files

Using this as a starter

This scaffold is meant to be renamed and extended:

  1. Rename the my-plugin folder and my-plugin.php file.
  2. Update the plugin header (Plugin Name, Text Domain, etc.) in my-plugin.php.
  3. Replace the MP_ constant prefix, mp_ function prefix, and MP_* class prefix with your own.
  4. Update the text domain (my-plugin) throughout, and in readme.txt.
  5. Remove or extend the example custom post type, REST route, and settings page for your actual feature.

License

GPL-2.0-or-later — see LICENSE.