2017 © Pedro Peláez
 

wordpress-plugin advanced-hooks-api

Set of (experimental) wrappers that allow to hook more elaborate WordPress events without coding intermediary functions

image

rarst/advanced-hooks-api

Set of (experimental) wrappers that allow to hook more elaborate WordPress events without coding intermediary functions

  • Friday, November 7, 2014
  • by Rarst
  • Repository
  • 2 Watchers
  • 19 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Advanced WordPress Hooks API

Set of (experimental) wrappers that allow to hook more elaborate WordPress events without coding intermediary functions., (*1)

WordPress only operates with callbacks for actions and filters. That means that you always need to use callback, either:, (*2)

  • provided by core (limited)
  • closures (messy)
  • coded by yourself (this - a lot)

This plugins offers number of custom add_* functions to hook more elaborate events:, (*3)

  • add_action_with_args() - hook callback and arguments to run it with
  • add_filter_return() - override filter with arbitrary value
  • add_filter_prepend() and add_filter_append() - hook suffix/prefix values for filtered string and arrays
  • add_filter_replace() - edit substrings or array values in filter
  • add_action_once() and add_filter_once() - hook callback to only fire once
  • add_method() - quickly add class methods to hooks of same name

Both implementation and set of functions are experimental., (*4)

Changelog

0.7

  • (enhancement) implemented add_action_once() and add_filter_once(), props Eric Mann

0.6

  • (enhancement) changed license to MIT
  • (enhancement) cleaned up coding style
  • (enhancement) moved handler class to separate file
  • (enhancement) implemented removing of handler from hooks
  • (breaking change) changed signatures to make priority optional

0.5

  • (enhancement) new add_method() function
  • (enhancement) more return points for better logic and compatibility

0.4.1

  • (bugfix) action() method expected argument passed (to be compatible with filters), changed to func_get_arg()

0.4

  • Initial public repository release.

The Versions

07/11 2014

dev-master

9999999-dev https://github.com/Rarst/advanced-hooks-api

Set of (experimental) wrappers that allow to hook more elaborate WordPress events without coding intermediary functions

  Sources   Download

MIT

The Requires

 

wordpress