Initial commit of 0.2.0
This commit is contained in:
56
ogre-obfuscation.php
Normal file
56
ogre-obfuscation.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Ogre Obfuscation
|
||||
Plugin URI: https://plugins.cleverogre.com/plugin/ogre-obfuscation/
|
||||
Description: Ogre Obfuscation is a plugin developed by CleverOgre in Pensacola, Florida.
|
||||
Version: 0.2.0
|
||||
Author: CleverOgre
|
||||
Author URI: http://cleverogre.com/
|
||||
Text Domain: obfuscation
|
||||
License: GPLv3 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
Copyright: CleverOgre, Inc.
|
||||
*/
|
||||
|
||||
namespace Ogre;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
final class Obfuscation extends Plugin {
|
||||
|
||||
protected function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->add_files([
|
||||
'inc/settings.php',
|
||||
'inc/global.php', // Global Functions
|
||||
'inc/filter.php', // Content and navigation filters
|
||||
]);
|
||||
}
|
||||
|
||||
protected function enable():void {
|
||||
parent::enable();
|
||||
add_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
|
||||
}
|
||||
|
||||
protected function disable():void {
|
||||
parent::disable();
|
||||
remove_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
|
||||
}
|
||||
|
||||
public function action_links($links) {
|
||||
if (current_user_can('manage_options')) {
|
||||
array_unshift($links, sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
esc_url(admin_url('options-general.php?page=obfuscation_settings')),
|
||||
esc_html(self::__('Settings'))
|
||||
));
|
||||
}
|
||||
return $links;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Obfuscation::instance();
|
||||
Reference in New Issue
Block a user