PaddlePress Pro allows you to set up automatic upgrades for WordPress themes.
Step 1 – Include Updater Files #
Please take a look our updater in the sample theme.
- Copy updater directory into your theme and change the namespace.
Then place the following code into your theme’s functions.php:
/**
* Load custom updater
*/
function your_theme_prefix_theme_updater() {
require get_template_directory() . '/updater/theme-updater.php';
}
add_action( 'after_setup_theme', 'your_theme_prefix_theme_updater' );
Step 2 – Configure Updater #
Edit /updater/theme-updater.php
$config = array(
'license_api_url' => 'http://example.org/wp-json/paddlepress-api/v1/license', // License endpoint
'update_api_url' => 'http://example.org/wp-json/paddlepress-api/v1/update', // Update endpoint
'theme_slug' => 'paddlepress-sample-theme', // Theme slug
'download_tag' => 'paddlepress-sample', // download tag
'version' => '1.0.0', // The current version of this theme
'author' => 'HandyPlugins', // The author of this theme
'beta' => false, // Optional, set to true to opt into beta versions
);