WP coding style
This commit is contained in:
@ -12,37 +12,38 @@ Version: 1.1.2
|
||||
*/
|
||||
|
||||
/* Quit */
|
||||
defined('ABSPATH') OR exit;
|
||||
defined( 'ABSPATH' ) OR exit;
|
||||
|
||||
/* Constants */
|
||||
define('STATIFYBLACKLIST_FILE', __FILE__);
|
||||
define('STATIFYBLACKLIST_DIR', dirname(__FILE__));
|
||||
define('STATIFYBLACKLIST_BASE', plugin_basename(__FILE__));
|
||||
define( 'STATIFYBLACKLIST_FILE', __FILE__ );
|
||||
define( 'STATIFYBLACKLIST_DIR', dirname( __FILE__ ) );
|
||||
define( 'STATIFYBLACKLIST_BASE', plugin_basename( __FILE__ ) );
|
||||
|
||||
/* System Hooks */
|
||||
add_action('plugins_loaded', array('StatifyBlacklist', 'instance'));
|
||||
add_action( 'plugins_loaded', array( 'StatifyBlacklist', 'instance' ) );
|
||||
|
||||
register_activation_hook(STATIFYBLACKLIST_FILE, array('StatifyBlacklist_System', 'install'));
|
||||
register_activation_hook( STATIFYBLACKLIST_FILE, array( 'StatifyBlacklist_System', 'install' ) );
|
||||
|
||||
register_uninstall_hook(STATIFYBLACKLIST_FILE, array('StatifyBlacklist_System', 'uninstall'));
|
||||
register_uninstall_hook( STATIFYBLACKLIST_FILE, array( 'StatifyBlacklist_System', 'uninstall' ) );
|
||||
|
||||
/* Autoload */
|
||||
spl_autoload_register('statifyBlacklist_autoload');
|
||||
spl_autoload_register( 'statifyBlacklist_autoload' );
|
||||
|
||||
/**
|
||||
* Autoloader for StatifyBlacklist classes.
|
||||
*
|
||||
* @param $class
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
function statifyBlacklist_autoload($class) {
|
||||
$plugin_classes = array(
|
||||
'StatifyBlacklist',
|
||||
'StatifyBlacklist_Admin',
|
||||
'StatifyBlacklist_System'
|
||||
);
|
||||
function statifyBlacklist_autoload( $class ) {
|
||||
$plugin_classes = array(
|
||||
'StatifyBlacklist',
|
||||
'StatifyBlacklist_Admin',
|
||||
'StatifyBlacklist_System'
|
||||
);
|
||||
|
||||
if (in_array($class, $plugin_classes)) {
|
||||
require_once(sprintf('%s/inc/%s.class.php', STATIFYBLACKLIST_DIR, strtolower($class)));
|
||||
}
|
||||
if ( in_array( $class, $plugin_classes ) ) {
|
||||
require_once( sprintf( '%s/inc/%s.class.php', STATIFYBLACKLIST_DIR, strtolower( $class ) ) );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user