Skip to content

Commit

Permalink
defining a base class from which all other components can inherit
Browse files Browse the repository at this point in the history
also getting rid of the version constant in place of a properly, defining a single entry point with the run function, and defining the plugin slug as a property
  • Loading branch information
tommcfarlin committed May 5, 2014
1 parent d29ebf7 commit b5549d5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugin-name/trunk/includes/class-plugin-name.php
Expand Up @@ -23,6 +23,20 @@
*/
class Plugin_Name {

protected $plugin_slug = 'plugin-name-slug';

This comment has been minimized.

Copy link
@GaryJones

GaryJones May 7, 2014

Contributor

If this is a protected property, then you should probably have a public getter for it, so other classes can grab it, without needing to extend from this class. Unless you're making a plugin within a plugin, there shouldn't be a case for considering the main plugin class to be extendable.


protected $version = '1.0.0';

protected $loader;

public function __construct( Plugin_Name_Loader $loader = NULL ) {
$this->loader = $loader;
}

public function run() {
$this->loader->run();
}

/**
* This class is used to define common functionality that exists between
* both the dashboard and the public-facing side of the website. Think
Expand Down

0 comments on commit b5549d5

Please sign in to comment.