Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Implement Artisan Command for Generating Hookable Classes #12

@ogorzalka

Description

@ogorzalka

This ticket involves creating an Artisan command that generates Hookable classes, designed to invoke WordPress actions or filters. These generated classes will be placed in the “App/Hooks” directory, streamlining the process of creating classes for handling WordPress hooks.

Tasks:

  1. Develop a new Artisan command named “make:hook” that accepts a class name as an argument. For instance, running php artisan make:hook MyHook should generate a Hookable class named “MyHook.”
  2. Design the command logic to generate the Hookable class file within the “App/Hooks” directory, following the specified code structure.
  3. Integrate necessary placeholders in the generated class file, such as the class name and comments.
  4. Implement validation checks to ensure that the class name adheres to proper naming conventions and does not conflict with existing classes.
  5. Test the “make:hook” command by generating a sample Hookable class and verifying its presence and contents in the “App/Hooks” directory.
  6. Update the documentation to provide clear instructions on how to use the “make:hook” command and generate Hookable classes for WordPress actions and filters.

Expected Outcome:
Upon completing this ticket, the framework will include a new Artisan command, “make:hook,” which streamlines the process of creating Hookable classes for WordPress actions and filters. Developers will be able to generate these classes with ease, enabling them to define custom behavior for WordPress hooks efficiently. The generated classes will adhere to the specified code structure and will be placed in the “App/Hooks” directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions