PHP code example of afragen / translations-updater
1. Go to this page and download the library: Download afragen/translations-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/ */
afragen / translations-updater example snippets
add_action( 'admin_init', function() {
$config = [
'git' => '(github|bitbucket|gitlab|gitea)',
'type' => '(plugin|theme)',
'slug' => 'my-repo-slug', // Should be lowercase.
'version' => 'my-repo-version', // Current version of plugin|theme.
'languages' => 'https://my-path-to/language-packs',
'branch' => 'master', // Default (optional).
];
( new \Fragen\Translations_Updater\Init() )->run( $config );
} );
( new \Fragen\Translations_Updater\Init() )->delete_cached_data();
( new \Fragen\Translations_Updater\Init( __NAMESPACE__ ) )->edd_run();
$edd_updater = new EDD_SL_Plugin_Updater( EDD_SAMPLE_STORE_URL, __FILE__, array(
'version' => '1.0', // current version number
'license' => $license_key, // license key (used get_option above to retrieve from DB)
'item_name' => EDD_SAMPLE_ITEM_NAME, // name of this plugin
'author' => 'Pippin Williamson', // author of this plugin
'beta' => false,
'git' => 'bitbucket',
'languages' => 'https://bitbucket.org/afragen/test-language-pack',
)
$updater = new EDD_Theme_Updater_Admin(
// Config settings
$config = array(
'remote_api_url' => 'https://easydigitaldownloads.com', // Site where EDD is hosted
'item_name' => 'Theme Name', // Name of theme
'theme_slug' => 'theme-slug', // Theme slug
'version' => '1.0.0', // The current version of this theme
'author' => 'Easy Digital Downloads', // The author of this theme
'download_id' => '', // Optional, used for generating a license renewal link
'renew_url' => '', // Optional, allows for a custom license renewal link
'beta' => false, // Optional, set to true to opt into beta versions
'git' => 'github',
'languages' => 'https://github.com/<USER>/my-language-pack',
),
...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.