PHP code example of madvault / slswc-client
1. Go to this page and download the library: Download madvault/slswc-client 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/ */
madvault / slswc-client example snippets
use SLSWC\Client\Plugin;
add_action( 'plugins_loaded', function () {
$client = Plugin::get_instance(
'https://your-license-server.com/',
__FILE__,
array(
'license_key' => get_option( 'my_plugin_license_key', '' ),
)
);
$client->init_hooks();
}, 11 );
use SLSWC\Client\Theme;
add_action( 'after_setup_theme', function () {
$theme = Theme::get_instance(
'https://your-license-server.com/',
WP_CONTENT_DIR . '/themes/my-theme',
array(
'license_key' => get_option( 'my_theme_license_key', '' ),
)
);
$theme->init_hooks();
} );
/**
* Plugin Name: My Plugin
* Version: 1.0.0
* Text Domain: my-plugin
*
* SLSWC: plugin
* SLSWC Documentation URL: https://example.com/docs
* SLSWC Compatible To: 6.9
*/
$client = Plugin::get_instance(
'https://your-license-server.com/',
__FILE__,
array(
'license_key' => get_option( 'my_plugin_license_key', '' ),
'drm' => array(
'enabled' => true,
'product_name' => 'My Plugin',
),
)
);