PHP code example of morningtrain / wp-plugin-info

1. Go to this page and download the library: Download morningtrain/wp-plugin-info 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/ */

    

morningtrain / wp-plugin-info example snippets


// plugin.php
 = Morningtrain\WP\PluginUpdater\PluginInfo::register(__FILE__);

$plugin_info->setNamedPath('app', __DIR__ . '/app');
$plugin_info->setNamedPath('logs', WP_CONTENT_DIR . '/logs');

$plugin_info->setNamedUrl('images', $plugin_info->getRootUrl() . 'public/iamges');
$plugin_info->setNamedUrl('invoices', content_url('private/invoices'));

$plugin_info->setNamedParameter('license', $license);

$plugin_info = Morningtrain\WP\PluginUpdater\PluginInfo::get('pluginSlug');