Skip to content

Filters

rogerlos edited this page Jun 16, 2017 · 20 revisions

The following filters are accessible via add_filter(). Included are sample closures, with comments

Javascript Localization

Filter the array of data which is being made available to flexwalker.js. Note that arbitrarily changing the structure or keys will probably break things.

/* 
 * $array contains the contents of $this->cfg['display'] as modified by the 
 * passed arguments when flexwalker( $args ). $this->cfg['display'] is initially
 * the contents of display.json
 */
add_filter( 'flexwalker_localize', function( $array ) {

    // turn off resize hiding
    $array['resizehide']['use'] = false;

    return $array;
}, 10, 1 );

Clone this wiki locally