Giter Club home page Giter Club logo

haste-toolkit's Introduction

Haste Toolkit

Haste Toolkit is plugin development starter, with some useful resources like composer autoload, LaravelMix, PHPCS and a small project structure to help you start your plugin development without caring too much about those simple things.

Getting Started

You will need to download and rename Haste Toolkit to reflect the name and slugs of your custom plugin to be developed, after that, you are ready to install and activate it, and start coding your fucntionalities!

  • Download the lastest version of Haste Toolkit
  • Extract it to your /plugins folder
  • Renaming
    • Rename it to the desired plugin slug. (Ex. my-plugin-name)
    • Rename the main plugin file to reflect the folder name.
    • Rename namespaces from HasteToolkitto MyPluginNamespace
    • Rename comments, prefixes and other stuff, searching for HasteToolkit, haste-toolkit, haste_toolkit, haste.
    • Important: rename the namespace in composer.json. The classes autoloader will use the values in that file to search for classes to include in the autoload generation.
  • Activate the plugin

The plugin will do nothing, so you're able to start developing your functionalities in the way you want. The main plugin file is responsible to register the plugin, load the translation, load the composer PSR-4 autoload, and require the functions.php file.

The functions.php file

The functions.php in the root of the plugin can be used almost like a functions.php of a theme. It was built to make easy to anyone familiar with WordPress theme functions to get started. Just put your hooks and callbacks there, and it should work!

OOP: Object Oriented Programming

The plugin structure comes with a basic folder structure based on modern PHP development. The folder /src is where classes and interfaces should be, subdivided by "domains". For example, the structure comes with /src/meta-boxes, in that folder classes related to meta boxes will be placed, like meta box creation helpers, custom meta boxes registrations, etc.

But, we could have a different approach, understanding domains as a different thing, we could group all classes related to a specific functionality together, even if it means we'll end with classes that deal with meta boxes, custom post types, API's, etc. in the same folder.

So, don't think too much about it, and get an approach that makes sense to you.

Autoload

To generate the composer autoload, for the first time, you just have to run composer install and that will do it. If you have added new namespaces, you should run composer dumpautoload -o.

haste-toolkit's People

Contributors

allysonsouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

haste-toolkit's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.