bp_xprofile_clear_field_cache( int|BP_XProfile_Field $field )

Clear a field’s caches.


Parameters Parameters

$field

(int|BP_XProfile_Field) (Required) A field ID or a field object.


Top ↑

Return Return

(bool) False on failure.


Source Source

File: bp-xprofile/bp-xprofile-cache.php

function bp_xprofile_clear_field_cache( $field ) {
	if ( is_numeric( $field ) ) {
		$field_id = (int) $field;
	} elseif ( $field instanceof BP_XProfile_Field ) {
		$field_id = (int) $field->id;
	}

	if ( ! isset( $field_id ) ) {
		return false;
	}

	wp_cache_delete( $field_id, 'bp_xprofile_fields' );
	wp_cache_delete( $field_id, 'xprofile_meta' );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.