Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
views
bootstrap.php
readme.md

readme.md

Updates Channels Module

This module enables developers to define different update channels for their custom updaters.

Register an update channel

Use wbf/update_channels/available filter.

/**
 * Adds the My Theme Update channels
 *
 * @param $channels
 *
 * @return mixed
 */
function set_update_channels($channels){
    $channels['mytheme'] = [
        'name' => 'My Theme',
        'slug' => 'my_theme',
        'channels' => [
            'Stable' => 'stable',
            'Beta' => 'beta'
        ]
    ];
    return $channels;
}
add_filter('wbf/update_channels/available','set_update_channels');

Now you can find the channel selector in the WBF Status page.

Use the channel

You can retrieve the selected channel with \WBF\modules\update_channels\get_update_channel($name) function.

use function WBF\modules\update_channels\get_update_channel;
$channel = get_update_channel("my_theme");
//Do the update logic with $channel...
//...