PHP code example of oblak / wp-package-updater
1. Go to this page and download the library: Download oblak/wp-package-updater library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oblak / wp-package-updater example snippets
namespace Vendor\My_Plugin;
use Oblak\WP\Plugin_Updater;
use Oblak\WP\Theme_Updater;
class My_Plugin_Updater extends Plugin_Updater {
protected function get_update_url() {
return 'https://my-plugin.com/api/update';
}
}
class My_Theme_Updater extends Theme_Updater {
protected function get_update_url() {
return 'https://my-theme.com/api/update';
}
}
use Vendor\My_Plugin\My_Plugin_Updater;
use Vendor\My_Plugin\My_Theme_Updater;
new My_Plugin_Updater('plugin-slug');
new My_Theme_Updater('theme-slug');