compare_releases ( string $current, string $latest, string $operator = '>' )

Compares release values.

Return: (bool)

Source file: app/functions/hook-function.php

View source


Parameters

$current

(string) (Required) Current release value.

$latest

(string) (Required) Latest release value.

$operator

(string) (Optional) Operand use to compare current and latest release values.

Default value: '>'


Used by


Source

function compare_releases($current, $latest, $operator = '>')
{
    $app = \Liten\Liten::getInstance();

    $php_function = version_compare($latest, $current, $operator);
    /**
     * Filters the comparison between two release.
     *
     * @since 6.1.14
     * @param $php_function PHP
     *            function for comparing two release values.
     */
    $release = $app->hook->apply_filter('compare_releases', $php_function);

    if ($release) {
        return $latest;
    } else {
        return false;
    }
}


Changelog


User Contributed Notes

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