PHP code example of laegel / wp-plugin-maker

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

    

laegel / wp-plugin-maker example snippets


 
namespace My_Plugin\Admin;

class Test_Controller {

    public static function action_init() {
        // Put your logic here
    }
    
}

 return array (
  'My_Plugin\\Admin\\Test_Controller' => 
  array (
    'actions' => 
    array (
      0 => 
      array (
        'name' => 'init',
        'callback' => 'My_Plugin\\Admin\\Test_Controller::action_init',
        'priority' => 10,
        'args_count' => 0,
      ),
    ),
  ),
);


add_action('init', 'My_Plugin\\Admin\\Test_Controller::action_init', 10, 0);


/**
 * @priority(0)
 */
public static function action_init() {}

my-plugin
|-- my-plugin.php
|-- -front.php
|--   |-- All
|   |   |-- (classes)
|   |-- CLI
|   |   |-- (classes)
|   |-- Front
|   |   |-- (classes)
|   |-- Rest
|   |   |-- (classes)
|   |-- Plugin.php
|   vendor
|   |-- (packages)