用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/wpgaurav/WordPress-skills --skill wp-plugin命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Author Bricks Builder (WordPress) layouts, templates, and full designs as paste-ready JSON. Use for any Bricks task — sections, pages, headers/footers, query loops, ACF/dynamic data, faceted filters, conditions, interactions/animations, popups, WooCommerce templates, custom elements, or hooks. Verified against Bricks 2.3.6 source.
Use when pushing content, docs, posts, changelogs, or other updates to Fluent Community spaces through the Fluent Community REST API.
Generate or edit design for WordPress Gutenberg blocks using Greenshift/GreenLight plugin. Convert any data to wordpress blocks or convert greenshift blocks back to html + css + js. Use when user asks to create design with Greenshift or Greenlight blocks for wordpress site, convert anything to wordpress blocks or build charts in content. Triggers on keywords: wordpress, gutenberg, greenshift, greenlight, convert to wordpress, convert greenshift blocks to vanilla html, build chart.
基于 SOC 职业分类
正在显示 SKILL.md
| name | wp-plugin |
| description | Quick scaffold for WordPress plugin development with proper structure, hooks, and best practices. |
Build production-ready WordPress plugins following best practices and WordPress coding standards.
/CLAUDE/context/wordpress-dev.md for standards/CLAUDE/knowledge/wordpress-hooks.md for hook reference/CLAUDE/knowledge/wordpress-patterns.md for common patterns<?php
/**
* Plugin Name: Plugin Name
* Plugin URI: https://example.com/plugin-name
* Description: Short description of the plugin.
* Version: 1.0.0
* Requires at least: 6.0
* Requires PHP: 8.0
* Author: Gaurav Tiwari
* Author URI: https://yoursite.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: plugin-name
* Domain Path: /languages
*
* @package PluginName
*/
defined( 'ABSPATH' ) || exit;
// Plugin constants
define( 'PLUGIN_NAME_VERSION', '1.0.0' );
define( 'PLUGIN_NAME_FILE', __FILE__ );
define( 'PLUGIN_NAME_PATH', plugin_dir_path( __FILE__ ) );
define( 'PLUGIN_NAME_URL', plugin_dir_url( __FILE__ ) );
// Autoloader
if ( file_exists( PLUGIN_NAME_PATH . 'vendor/autoload.php' ) ) {
require_once PLUGIN_NAME_PATH . 'vendor/autoload.php';
}
// Initialize plugin
function plugin_name_init() {
// Load text domain
load_plugin_textdomain(
'plugin-name',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages'
);
// Initialize main class
if ( class_exists( 'PluginName\\Plugin' ) ) {
\PluginName\Plugin::instance();
}
}
add_action( 'plugins_loaded', 'plugin_name_init' );
// Activation hook
register_activation_hook( __FILE__, 'plugin_name_activate' );
function plugin_name_activate() {
// Check requirements
if ( version_compare( PHP_VERSION, '8.0', '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( esc_html__( 'This plugin requires PHP 8.0 or higher.', 'plugin-name' ) );
}
// Run activation tasks
if ( class_exists( 'PluginName\\Activator' ) ) {
\PluginName\Activator::activate();
}
// Set activation flag for redirect
set_transient( 'plugin_name_activated', true, 30 );
}
// Deactivation hook
register_deactivation_hook( __FILE__, 'plugin_name_deactivate' );
function plugin_name_deactivate() {
if ( class_exists( 'PluginName\\Deactivator' ) ) {
\PluginName\Deactivator::deactivate();
}
}
<?php
/**
* Main plugin class.
*
* @package PluginName
*/
namespace PluginName;
defined( 'ABSPATH' ) || exit;
/**
* Plugin class.
*/
final class Plugin {
/**
* Plugin instance.
*
* @var Plugin|null
*/
private static $instance = null;
/**
* Plugin version.
*
* @var string
*/
public $version = PLUGIN_NAME_VERSION;
/**
* Get plugin instance.
*
* @return Plugin
*/
public static function instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor.
*/
private function __construct() {
$this->define_constants();
$this->();
->();
}
{}
{
( );
}
{
}
{
PLUGIN_NAME_PATH . ;
( () ) {
PLUGIN_NAME_PATH . ;
}
( ! () ) {
PLUGIN_NAME_PATH . ;
}
}
{
( , ( , ), );
( , ( , ) );
}
{
( );
}
{
( ( ) ) {
( );
( ! ( [] ) ) {
( ( ) );
;
}
}
}
{
PLUGIN_NAME_URL . ( , );
}
{
PLUGIN_NAME_PATH . ( , );
}
}
<?php
/**
* Admin settings.
*
* @package PluginName
*/
namespace PluginName;
defined( 'ABSPATH' ) || exit;
/**
* Admin class.
*/
class Admin {
/**
* Option name.
*
* @var string
*/
private $option_name = 'plugin_name_settings';
/**
* Constructor.
*/
public function __construct() {
add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
add_action( 'admin_init', array( $this, 'register_settings' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
/**
* Add menu page.
*/
public function add_menu_page() {
add_menu_page(
__( 'Plugin Name', 'plugin-name' ),
__( 'Plugin Name', ),
,
,
( , ),
,
);
(
,
( , ),
( , ),
,
,
( , )
);
}
{
(
,
->option_name,
(
=> ,
=> ( , ),
=> ->(),
)
);
(
,
( , ),
( , ),
);
(
,
( , ),
( , ),
,
,
(
=> ,
=> ( , ),
)
);
(
,
( , ),
( , ),
,
,
(
=> ,
=> ,
=> ( , ),
)
);
}
{
(
=> ,
=> ,
);
}
{
= ( ->option_name, ->() );
[ ] ?? ?? ->()[ ] ?? ;
}
{
= ();
[] = ( [] ) ? () [] : ;
[] = ( [] ?? );
;
}
{
( ! ( ) ) {
;
}
( ( [] ) ) {
(
,
,
( , ),
);
}
( );
<div {
. ( , ) . ;
}
{
= ->( [] );
<label>
<input
type=
name=
value=
( , );
/>
( [] );
</label>
}
{
= ->( [] );
= [] ?? ;
<input
type=
name=
value=
{
( !== ) {
;
}
(
,
PLUGIN_NAME_URL . ,
(),
PLUGIN_NAME_VERSION
);
(
,
PLUGIN_NAME_URL . ,
( ),
PLUGIN_NAME_VERSION,
);
(
,
,
(
=> ( ),
=> ( ),
)
);
}
}
<?php
/**
* AJAX handler.
*
* @package PluginName
*/
namespace PluginName;
defined( 'ABSPATH' ) || exit;
/**
* Ajax class.
*/
class Ajax {
/**
* Constructor.
*/
public function __construct() {
// Admin AJAX
add_action( 'wp_ajax_plugin_name_action', array( $this, 'handle_action' ) );
// Public AJAX (logged in + logged out)
add_action( 'wp_ajax_plugin_name_public', array( $this, 'handle_public_action' ) );
add_action( 'wp_ajax_nopriv_plugin_name_public', array( $this, 'handle_public_action' ) );
}
/**
* Handle admin AJAX action.
*/
public function handle_action() {
// Verify nonce
if ( ! check_ajax_referer( 'plugin_name_admin', 'nonce', false ) ) {
wp_send_json_error(
( => ( , ) ),
);
}
( ! ( ) ) {
(
( => ( , ) ),
);
}
= ( [] ) ? ( ( [] ) ) : ;
( ( ) ) {
(
( => ( , ) ),
);
}
{
= ->( );
( ( => ) );
} ( \ ) {
(
( => ->() ),
);
}
}
{
;
}
{
( ! ( , , ) ) {
( ( => ( , ) ) );
}
= ( ( [] ?? ) );
( ->( ) ) {
(
( => ( , ) ),
);
}
( ( => ) );
}
{
= . ( );
= () ( );
( >= ) {
;
}
( , + , MINUTE_IN_SECONDS );
;
}
}
<?php
/**
* REST API.
*
* @package PluginName
*/
namespace PluginName;
defined( 'ABSPATH' ) || exit;
/**
* REST_API class.
*/
class REST_API {
/**
* Namespace.
*
* @var string
*/
private $namespace = 'plugin-name/v1';
/**
* Constructor.
*/
public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_routes' ) );
}
/**
* Register routes.
*/
public function register_routes() {
register_rest_route(
$this->namespace,
'/items',
array(
array(
'methods' => \WP_REST_Server::READABLE,
'callback' => array( $this, 'get_items' ),
'permission_callback' => array( $this, ),
=> ->(),
),
(
=> ::,
=> ( , ),
=> ( , ),
=> ->(),
),
)
);
(
->namespace,
,
(
(
=> ::,
=> ( , ),
=> ( , ),
=> (
=> (
=> {
( );
},
),
),
),
(
=> ::,
=> ( , ),
=> ( , ),
),
(
=> ::,
=> ( , ),
=> ( , ),
),
)
);
}
{
(
=> (
=> ,
=> ,
),
=> (
=> ,
=> ,
),
=> (
=> ,
),
);
}
{
(
=> (
=> ,
=> ,
),
=> (
=> ,
),
);
}
{
;
}
{
( );
}
{
= ->( );
= ->( );
= ->( );
= ();
( );
}
{
= ->( );
= ->( );
= (
(
=> ,
=> ,
=> ,
=> ,
)
);
( ( ) ) {
;
}
(
(
=> ,
=> ( , ),
)
);
}
}
<?php
/**
* Register custom post type.
*
* @package PluginName
*/
namespace PluginName;
defined( 'ABSPATH' ) || exit;
/**
* Post_Types class.
*/
class Post_Types {
/**
* Constructor.
*/
public function __construct() {
add_action( 'init', array( $this, 'register_post_types' ) );
add_action( 'init', array( $this, 'register_taxonomies' ) );
}
/**
* Register post types.
*/
public function register_post_types() {
$labels = array(
'name' => _x( 'Items', 'Post type general name', 'plugin-name' ),
'singular_name' => _x( 'Item', 'Post type singular name', 'plugin-name' ),
'menu_name' => _x( 'Items', 'Admin Menu text', ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
);
= (
=> ,
=> ,
=> ,
=> ,
=> ,
=> ,
=> ,
=> ( => ),
=> ,
=> ,
=> ,
=> ,
=> ,
=> ( , , , , ),
);
( , );
}
{
= (
=> ( , , ),
=> ( , , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
=> ( , ),
);
= (
=> ,
=> ,
=> ,
=> ,
=> ,
=> ,
=> ( => ),
);
( , ( ), );
}
}
<?php
/**
* Uninstall script.
*
* @package PluginName
*/
// Exit if not called from WordPress.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
// Delete options
delete_option( 'plugin_name_settings' );
delete_option( 'plugin_name_version' );
// Delete transients
delete_transient( 'plugin_name_cache' );
// Delete user meta (if applicable)
delete_metadata( 'user', 0, 'plugin_name_user_data', '', true );
// Drop custom tables (if applicable)
global $wpdb;
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}plugin_name_table" );
// Clear scheduled hooks
wp_clear_scheduled_hook( 'plugin_name_cron_event' );
// Clean up uploads (optional - be careful)
// $upload_dir = wp_upload_dir();
// $plugin_dir = $upload_dir['basedir'] . '/plugin-name';
// if ( is_dir( $plugin_dir ) ) {
// // Recursive delete
// }
Before releasing: