Italian (Italy)
Knowledge Base  >  VikUpdater  >  Sviluppatori  >  Temi  >  Download URL - Extra Query

apply_filters( 'vikupdater_download_theme_extra_query', array $args, object $manifest, array $options )

Filter used to apply an extra query to the URL needed to download the latest package of a theme.


Description

It is possible to use this hook to extend at runtime the query string of the URL needed to download the latest version of a theme.

Commercial themes might deploy updates only in case the requestors are actually certified customers. It is recommended to use this hook to include custom parameters aiming to restrict the download of a package.


Parameters

$args

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

$manifest

(object)  The theme manifest (JSON-decoded) fetched through the API call made on the theme "check" URL. 

$options

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


Example

The example below explains how to receive (at server level) a parameter containing the order number of a customer.

function your_theme_vikupdater_download_extra_query( $args, $manifest, $options ) {
    // make sure we are observing our theme
    if ( 'your-theme' === $options['slug'] ) {
        // load order number from the WP config
        $args['order_number'] = get_option( 'yourtheme_order_number' );
    }

    return $args;
}

add_filter( 'vikupdater_download_theme_extra_query', 'your_theme_vikupdater_download_extra_query', 10, 3 );

Changelog

Version Description
2.0 Introduced.
Ultimo aggiornamento: 2023-11-21
Utile?