Advanced wrapper for filters

v1.0.0 2023-02-24 13:09 UTC

This package is auto-updated.

Last update: 2024-10-24 17:28:05 UTC


README

Usage

use ThemePlate\Hook;

// Hook::<ACTION>( <TAG>, <VALUE> )
Hook::append( 'sample_filter', 'ing' );
Hook::prepend( 'sample_filter', 're-' );
Hook::return( 'sample_filter', 'this!' );
Hook::pluck( 'sample_filter', 'i' );
Hook::replace( 'sample_filter', '!', '...' );
Hook::insert( 'sample_filter', 'u', 2 );
Hook::once( 'sample_filter', array( 'pluck', 'th' ) );

^Line by line output with initial value test

// apply_filters( <TAG>, <INITIAL> );
apply_filters( 'sample_filter', 'test' ); // <RESULT #1>
apply_filters( 'sample_filter', 'test' ); // <RESULT #2>