Skip to content

Instantly share code, notes, and snippets.

@jbutkus
Forked from borislav-angelov/gist:7520027
Last active December 28, 2015 15:59
Show Gist options
  • Save jbutkus/7525638 to your computer and use it in GitHub Desktop.
Save jbutkus/7525638 to your computer and use it in GitHub Desktop.
<?php
$dispatcher = new Ai1ec_Event_Dispatcher();
$callback_filter = new Ai1ec_Event_Callback_Filter( $this->_registry, 'model.settings', 'modify2' );
$dispatcher->register( 'title', $callback_filter, 19, 2 );
$callback_filter2 = new Ai1ec_Event_Callback_Filter( $this->_registry, 'model.settings', 'modify' );
$dispatcher->register( 'title', $callback_filter2, 17, 2 );
$callback_filter3 = new Ai1ec_Event_Callback_Filter( $this->_registry, 'model.settings', 'modify' );
$dispatcher->register( 'title', $callback_filter3, 22, 2 );
echo 'Result: ' . apply_filters( 'title', 'Long Name', 23 );
// Result: Long Name (23) [23] (23)
echo 'Result: ' . apply_filters( 'title', 'Other Name', 2 );
echo 'Result: ' . apply_filters( 'title', 'Justas is bad', 8 );
echo 'Result: ' . apply_filters( 'title', 'But not very much', 123 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment