Skip to content

Instantly share code, notes, and snippets.

@rileypaulsen
Last active October 19, 2023 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rileypaulsen/591eaf5c45fcd683bca8 to your computer and use it in GitHub Desktop.
Save rileypaulsen/591eaf5c45fcd683bca8 to your computer and use it in GitHub Desktop.
Basic plugin boilerplate
<?php
/**
* Plugin Name: Name
* Plugin URI: http://
* Description: Description
* Version: 1.0.0
* Author: Name
* Author URI: http://
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: plugin-name
* Domain Path: /languages
*/
if( !class_exists('ClassName') ){
class ClassName {
public function __construct() {
add_action( 'init', [$this, 'init'] );
}
public function init(){
//start adding hooks (add_action and/or add_filter) here
}
}
new ClassName();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment