Skip to content

Instantly share code, notes, and snippets.

View shellycole's full-sized avatar

Shelly Cole shellycole

  • Brass Blogs Web Design
  • CT
View GitHub Profile
@shellycole
shellycole / add-wordpress-settings-page.php
Last active September 6, 2020 20:24 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
// Specify Hooks/Filters
//register_activation_hook( __FILE__, 'add_defaults_fn' ); // adds nothing to the DB using this
add_action( 'admin_init', 'add_defaults_fn' ); // works in place of the above line - temporary fix
add_action( 'admin_init', 'sampleoptions_init_fn' );
add_action( 'admin_menu', 'sampleoptions_add_page_fn' );
// Define the plugin prefix for easy changing throughout this file
define( 'PLUGIN_PREFIX', 'plugin_' ); // for prefixes with underscores
define( 'PLUGIN_PREFIX_DASH', 'plugin-' ); // for prefixes with dashes
// Define the plugin title - for samereasons as above