Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/20/2018 02:38:18 PM (6 years ago)
Author:
boonebgorges
Message:

bp-legacy: Disable cookie-based directory filter "preferences" for logged-out users.

Logged-out users who refresh the page will see the filters reset to their
default values, rather than the last-used value. Logged-in users continue
to have their preferences saved in a cookie.

This behavior is configurable with the 'bp_legacy_store_filter_settings'
filter.

See #7856.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r12198 r12255  
    284284
    285285        /**
     286         * Filters whether directory filter settings ('scope', etc) should be stored in a persistent cookie.
     287         *
     288         * @since 4.0.0
     289         *
     290         * @param bool $store_filter_settings Whether to store settings. Defaults to true for logged-in users.
     291         */
     292        $store_filter_settings = apply_filters( 'bp_legacy_store_filter_settings', is_user_logged_in() );
     293
     294        /**
    286295         * Filters core JavaScript strings for internationalization before AJAX usage.
    287296         *
     
    291300         */
    292301        $params = apply_filters( 'bp_core_get_js_strings', array(
     302            // Strings for display.
    293303            'accepted'            => __( 'Accepted', 'buddypress' ),
    294304            'close'               => __( 'Close', 'buddypress' ),
     
    304314            'unsaved_changes'     => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
    305315            'view'                => __( 'View', 'buddypress' ),
     316
     317            // Settings.
     318            'store_filter_settings' => $store_filter_settings,
    306319        ) );
    307320        wp_localize_script( $asset['handle'], 'BP_DTheme', $params );
Note: See TracChangeset for help on using the changeset viewer.