Skip to content

Commit

Permalink
Function renames and revised comments
Browse files Browse the repository at this point in the history
  • Loading branch information
allysonsouza committed Mar 13, 2017
1 parent 4029034 commit e99db91
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions odin-toolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Domain Path: languages/
*/

// Previne acesso direto
// Prevents direct access
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Expand Down Expand Up @@ -48,7 +48,7 @@ class Odin_Toolkit {
function __construct() {
$this->plugin_dir = plugin_dir_path( __FILE__ );
add_action( 'init', array( $this, 'load_textdomain' ) );
add_action( 'init', array( $this, 'include_odin_toolkit' ), 0 );
add_action( 'init', array( $this, 'includes' ), 0 );
}

/**
Expand All @@ -64,7 +64,7 @@ public static function init()
}

/**
* Return file name in odin pattern from class name.
* Return file name in odin pattern from class name. {Odin_Class_Name}
*
* @param string $class
* @return string
Expand All @@ -83,17 +83,13 @@ private function get_file_name_from_class( $class ) {
*
* @since 1.0.0
*/
public function include_odin_toolkit() {
public function includes() {
if ( ! defined( 'ODIN_TOOLKIT_VERSION' ) ) {
define( 'ODIN_TOOLKIT_VERSION', self::VERSION );
}

if ( ! defined( 'ODIN_TOOLKIT_DIR' ) ) {
define( 'ODIN_TOOLKIT_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
}

// Now kick off the class autoloader.
spl_autoload_register( array( $this, 'odin_toolkit_autoload_classes' ) );
spl_autoload_register( array( $this, 'autoload_classes' ) );
}

/**
Expand All @@ -102,7 +98,7 @@ public function include_odin_toolkit() {
* @since 1.0.0
* @param string $class_name Name of the class being requested
*/
public function odin_toolkit_autoload_classes( $class_name ) {
public function autoload_classes( $class_name ) {
if ( 0 !== strpos( $class_name, 'Odin' ) ) {
return;
}
Expand All @@ -114,7 +110,7 @@ public function odin_toolkit_autoload_classes( $class_name ) {
$path .= '/abstracts';
}

include_once( ODIN_TOOLKIT_DIR . "/$path/$file" );
include_once( $this->plugin_dir . "/$path/$file" );
}

/**
Expand Down

0 comments on commit e99db91

Please sign in to comment.