Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/20/2021 04:02:43 PM (5 months ago)
Author:
dcavins
Message:

Introduce BP_Optouts.

Add capability to store opt-out requests from
nonmembers who have been contacted by
communication from a BuddyPress site. These
new objects are represented by the class BP_Optout
and are stored in a new database table
wp_bp_optouts. This commit adds the following capabilities:

  • Add new class BP_Optout.
  • Add new table wp_bp_optouts.
  • Create new table on installation or upgrade.
  • Add convenience functions for adding, fetching or

deleting opt-outs.

  • Add tests for basic opt-out management.

See #8448.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-cache.php

    r12729 r12898  
    416416add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
    417417add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
     418
     419/**
     420 * Resets all incremented bp_optout caches.
     421 *
     422 * @since 8.0.0
     423 */
     424function bp_optouts_reset_cache_incrementor() {
     425    bp_core_reset_incrementor( 'bp_optouts' );
     426}
     427add_action( 'bp_optout_after_save', 'bp_optouts_reset_cache_incrementor' );
     428add_action( 'bp_optout_after_delete', 'bp_optouts_reset_cache_incrementor' );
Note: See TracChangeset for help on using the changeset viewer.