Gists

by djrmom - 3 months ago

<?php
/** remove facet's custom javascript for woocommerce **/
add_filter( 'facetwp_assets', function( $assets ) {
    unset( $assets['woocommerce.js'] );
    return $assets;
});
by djrmom - 3 months ago

<?php
/** remove facet's copy of google maps when another plugin or theme is already loading it **/
add_filter( 'facetwp_assets', function( $assets ) {
    unset( $assets['gmaps'] );
    return $assets;
});
by mgibbs189 - 8 months ago

<?php

add_filter( 'facetwp_load_assets', '__return_true' );

add_filter( 'facetwp_assets', function( $assets ) {
    $assets['fSelect.js'] = FACETWP_URL . '/assets/vendor/fSelect/fSelect.js';
    $assets['fSelect.css'] = FACETWP_URL . '/assets/vendor/fSelect/fSelect.css';
    return $assets;
});

by mgibbs189 - 2 years ago

<?php

add_filter( 'facetwp_assets', function( $assets ) {
    FWP()->display->json['expand'] = '<span>expand</span>';
    FWP()->display->json['collapse'] = '<span>collapse</span>';

    // Return the same thing (since we're hijacking this hook)
    return $assets;
});

by mgibbs189 - 2 years ago

<?php

add_filter( 'facetwp_assets', function( $assets ) {

    // Populate "FWP_JSON.neighborhood_data"
    FWP()->display->json['neighborhood_data'] = array(
        'academy' => array(
            'title' => 'Academy',
            'description' => 'This is the description',
            'image' => 'http://image.url',
        ),
        'airport' => array(
            'title' => 'Airport',
            'description' => 'This is the description',
            'image' => 'http://image.url',
        )
    );

    // Return the same thing (since we're hijacking this hook)
    return $assets;
});
by mgibbs189 - 3 weeks ago

<?php

add_filter( 'facetwp_assets', function( $assets ) {
    $assets['accessibility.js'] = FACETWP_URL . '/assets/js/src/accessibility.js';
    return $assets;
});
by mgibbs189 - 3 years ago

<?php

add_filter( 'facetwp_assets', function( $assets ) {
    foreach ( $assets as $key => $url ) {
        $assets[ $key ] = s3_url_for( $url );
    }
    return $assets;
}, 999 );
by mgibbs189 - 4 years ago

<?php

add_filter( 'facetwp_assets', function( $assets ) {
    if ( false !== strpos( FWP()->helper->get_uri(), 'add-listing' ) ) {
        unset( $assets['event-manager.js'] );
    }
    return $assets;
});