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

Compares release values.

Return: (bool)

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

View source



(string) (Required) Current release value.


(string) (Required) Latest release value.


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

Default value: '>'

Used by


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;


User Contributed Notes

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