bp_is_update()

Is this a BuddyPress update?


Description Description

Determined by comparing the registered BuddyPress version to the version number stored in the database. If the registered version is greater, it’s an update.


Return Return

(bool) True if update, otherwise false.


Top ↑

Source Source

File: bp-core/bp-core-update.php

function bp_is_update() {

	// Current DB version of this site (per site in a multisite network).
	$current_db   = bp_get_option( '_bp_db_version' );
	$current_live = bp_get_db_version();

	// Compare versions (cast as int and bool to be safe).
	$is_update = (bool) ( (int) $current_db < (int) $current_live );

	// Return the product of version comparison.
	return $is_update;
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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