English (United Kingdom)
Knowledge Base  >  VikUpdater  >  Developers  >  Plugins  >  Check URL - Extra Query

apply_filters( 'vikupdater_check_plugin_extra_query', array $args, array $options )

Filter used to apply an extra query to the URL needed to check the latest package of a plugin.


Description

It is possible to use this hook to extend at runtime the query string of the URL needed to download the JSON manifest of the requested plugin.


Parameters

$args

(array)  An associative array holding the extra parameters to add to the query string of the "check" URL.

$options

(array)  A configuration array, taken from the associative array specified during the subscription of the plugin.


Example

The example below explains how to receive (at server level) a parameter indicating the accepted stability (RC, nightly, stable and so on).

function your_plugin_vikupdater_check_extra_query( $args, $options ) {
    // make sure we are observing our plugin
    if ( 'your-plugin' === $options['slug'] ) {
        // include within the URL: `&stability={stability}`
        $args['stability'] = get_option('yourplugin_update_stability', 'stable');
    }

    return $args;
}

add_filter( 'vikupdater_check_plugin_extra_query', 'your_plugin_vikupdater_check_extra_query', 10, 2 );

Changelog

Version Description
2.0 Introduced.
Last Update: 2023-11-21
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.