Download the PHP package morningtrain/wp-hooks without Composer

On this page you can find all versions of the php package morningtrain/wp-hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-hooks

WP Hooks

To let you organize all your WordPress actions and filters.

Table of Contents

Introduction

This tool is made for organizing WordPress hooks.

This tool lets you:

Getting Started

To get started install the package as described below in Installation.

To use the tool have a look at Usage

Installation

Install with composer

Dependencies

morningtrain/php-loader

PHP Loader is used to load and initialize all Hooks

morningtrain/wp-view (optional)

WP View is used to load and initialize all Hooks

Usage

To load all Hooks of a given directory

Multiple Directories

Since this tool uses PHP Loader, you may use multiple directories.

Creating a Hook

To create a hook first call Hook::action, Hook::filter or Hook::view. Then start a chain to add additional parameters.

Adding an action

To add an action call Hook::action. You may either add the callback as the second parameter or by using handle()

Note that it is not necessary to define the number of args for the callback. The action (or filter) will look at the callback's definition to know how many arguments it takes.

Adding a filter

Adding filters is just like adding action. Call Hook::filter. You may either add the callback as the second parameter or by using filter()

Note that it is not necessary to define the number of args for the callback. The action (or filter) will look at the callback's definition to know how many arguments it takes.

Adding a view on an action

You may, if the morningtrain/wp-view package is installed, render a blade view directly from an action.

Note that you MUST define the number of args used in the hook since the hook has no callback method to analyze.

If you need to use the action params in your view you may render your view from another method or use view composing.

Using single use handlers (invokable)

You can use a single use class like so:

Credits

Testing

License

The MIT License (MIT). Please see License File for more information.


All versions of wp-hooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
morningtrain/php-loader Version ^0.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package morningtrain/wp-hooks contains the following files

Loading the files please wait ....