PHP code example of sherv / wp-plugin-foundation

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

    

sherv / wp-plugin-foundation example snippets


use Sherv\Foundation\Plugin;

$plugin = Plugin::new( __FILE__ )
    ->with_plugin_properties()
    ->with_providers()
    ->build();

register_activation_hook( __FILE__, [ $plugin, 'on_plugin_activation' ] );
register_deactivation_hook( __FILE__, [ $plugin, 'on_plugin_deactivation' ] );

add_action( 'plugins_loaded', [ $plugin, 'boot' ] );