<?php /* Plugin Name: some name Version: 0.1 Author URI: https://justicebeard.com/ */ class MyUniquePluginDescriptorClassName { function __construct(){ add_action('admin_menu', array($this,'dashboardInfo')); add_action('admin_init', array($this,'customSettings')); } function customSettings(){ register_setting(); } function dashboardInfo(){ add_options_page( 'HTML Title', 'Settings Text', 'manage_options', 'plugin-slug', array($this,'dashboardOutput')) // arguments: // https://developer.wordpress.org/reference/functions/add_options_page/ ); } function dashboardOutput(){ ?> <div class="my-plugin-dashboard"> <h1>Settings or whatever</h1> content to be displayed on the dashboard settings page </div> <?php } } $myUniquePluginDescriptorClassName = new MyUniquePluginDescriptorClassName();
Plugin starter boilerplate
Inside the core plugin file (not necessarily index.php or plugin-name.php):