PHP code example of piotrpress / wordpress-plugin

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

    

piotrpress / wordpress-plugin example snippets


/**
 * Plugin Name:       Example Plugin
 * Plugin URI:        https://example.com/plugin/
 * Description:       Example Plugin description.
 * Version:           1.0.0
 * Requires at least: 6.2.2
 * Requires PHP:      7.4
 * Author:            John Smith
 * Author URI:        https://example.com/plugin/author/
 * License:           GPL v3 or later
 * License URI:       https://www.gnu.org/licenses/gpl-3.0.txt
 * Update URI:        https://example.com/plugin/update/
 * Text Domain:       example-plugin
 * Domain Path:       /languages
 */


add_filter( 'extra_plugin_headers', function () {
    return [ 'License', 'License URI' ];
} );

class Example extends Plugin {
    public static function getLicenseURI() {
        return self::get( 'License URI' );
    }
}