Skip to content

Commit

Permalink
use organization prefixed namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
5t111111 committed Jan 17, 2024
1 parent f1a48d8 commit 90f82d5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
"wordpress",
"plugin"
],
"homepage": "https://github.com/kodansha/killer-pads",
"type": "wordpress-plugin",
"authors": [
{
"name": "Kodansha Ltd.",
"name": "KODANSHA Ltd.",
"homepage": "https://github.com/kodansha"
},
{
"name": "Hirofumi Wakasugi",
"homepage": "https://github.com/5t111111"
}
],
"type": "wordpress-plugin",
"homepage": "https://github.com/kodansha/killer-pads",
"license": "GPL v2 or later",
"require": {
"php": ">=7.3"
},
"autoload": {
"psr-4": {
"KillerPads\\": "src"
"Kodansha\\KillerPads\\": "src/"
}
}
}
18 changes: 13 additions & 5 deletions killer-pads.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
require_once __DIR__ . '/vendor/autoload.php';
}

(new KillerPads\AdminPad())->init();
(new KillerPads\RestRoutesPad())->init();
(new KillerPads\SecurityPad())->init();
/**
* Initialize plugin
*/
function init()
{
(new Kodansha\KillerPads\AdminPad())->init();
(new Kodansha\KillerPads\RestRoutesPad())->init();
(new Kodansha\KillerPads\SecurityPad())->init();

if (!(defined('KILLER_PADS_ENABLE_COMMENTS') && KILLER_PADS_ENABLE_COMMENTS == true)) {
(new KillerPads\CommentsPad())->init();
if (!(defined('KILLER_PADS_ENABLE_COMMENTS') && KILLER_PADS_ENABLE_COMMENTS == true)) {
(new Kodansha\KillerPads\CommentsPad())->init();
}
}

add_action('plugins_loaded', 'init', PHP_INT_MAX - 1);
2 changes: 1 addition & 1 deletion src/AdminPad.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KillerPads;
namespace Kodansha\KillerPads;

class AdminPad
{
Expand Down
2 changes: 1 addition & 1 deletion src/CommentsPad.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KillerPads;
namespace Kodansha\KillerPads;

/**
* Completely disable comments in WordPress
Expand Down
2 changes: 1 addition & 1 deletion src/RestRoutesPad.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KillerPads;
namespace Kodansha\KillerPads;

use WP_Error;

Expand Down
2 changes: 1 addition & 1 deletion src/SecurityPad.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace KillerPads;
namespace Kodansha\KillerPads;

class SecurityPad
{
Expand Down

0 comments on commit 90f82d5

Please sign in to comment.