定制 yard/brave-hooks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yard/brave-hooks

Composer 安装命令:

composer require yard/brave-hooks

包简介

Brave hooks

README 文档

README

Code Style

Features

  • Register Hooks using php attributes
  • Configure Hook registration using a config file
  • Load plugin-specific hooks only when the plugin is active

Installation

  1. Install this package with Composer:

    composer require yard/brave-hooks
  2. Run the Acorn WP-CLI command to discover this package:

    wp acorn package:discover
  3. Publish the config file with:

    wp acorn vendor:publish --provider="Yard\Brave\Hooks\HookServiceProvider"
  4. Register all your project hooks in the published configuration file config/hooks.php.

Usage

Add your custom hook classes to the hooks configuration file. Any hooks defined within these classes will be automatically registered with WordPress.

This plugin leverages wp-hook-registrar for hook registration. For detailed information about the hook registration process, please refer to that package's documentation.

Plugin-specific Hooks

Some classes contain hooks that should only be active when a specific WordPress plugin is active. To achieve this, add the #[Plugin] attribute to the class containing hooks and provide the plugin's file path:

The plugin path should match the format required by the WordPress function is_plugin_active()

#[Plugin('advanced-custom-fields-pro/acf.php')]
class ACF
{
    ...
}

About us

banner

统计信息

  • 总下载量: 3.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固