Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Use WP Contained Hook #55

Merged
merged 5 commits into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"typisttech/cloudflare-wp-api": "^0.3.0",
"typisttech/imposter-plugin": "^0.2.5",
"typisttech/wp-better-settings": "^0.11.0",
"typisttech/wp-contained-hook": "^0.1.0",
"yoast/i18n-module": "^2.0"
},
"require-dev": {
Expand Down
77 changes: 76 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

131 changes: 0 additions & 131 deletions src/AbstractHook.php

This file was deleted.

49 changes: 0 additions & 49 deletions src/Action.php

This file was deleted.

5 changes: 3 additions & 2 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\Pages\SubmenuPage;
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\Section;
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\SettingRegister;
use TypistTech\WPCFG\Vendor\TypistTech\WPContainedHook\Action;

/**
* Final class Admin.
Expand Down Expand Up @@ -71,8 +72,8 @@ public function __construct(OptionStore $optionStore)
public static function getHooks(): array
{
return [
new Action(__CLASS__, 'admin_menu', 'registerPages'),
new Action(__CLASS__, 'admin_init', 'registerSettings'),
new Action('admin_menu', __CLASS__, 'registerPages'),
new Action('admin_init', __CLASS__, 'registerSettings'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Ads/I18nPromoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

namespace TypistTech\WPCFG\Ads;

use TypistTech\WPCFG\Action;
use TypistTech\WPCFG\Admin;
use TypistTech\WPCFG\Container;
use TypistTech\WPCFG\LoadableInterface;
use TypistTech\WPCFG\Vendor\TypistTech\WPContainedHook\Action;
use TypistTech\WPCFG\Vendor\Yoast_I18n_WordPressOrg_v2;

/**
Expand Down Expand Up @@ -63,7 +63,7 @@ public function __construct(Admin $admin, Container $container)
public static function getHooks(): array
{
return [
new Action(__CLASS__, 'admin_menu', 'addYoastI18nModuleToMenuPages', 20),
new Action('admin_menu', __CLASS__, 'addYoastI18nModuleToMenuPages'),
];
}

Expand Down
6 changes: 3 additions & 3 deletions src/BadLogin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

namespace TypistTech\WPCFG\BadLogin;

use TypistTech\WPCFG\Filter;
use TypistTech\WPCFG\LoadableInterface;
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\Fields\Textarea;
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\Pages\SubmenuPage;
use TypistTech\WPCFG\Vendor\TypistTech\WPBetterSettings\Section;
use TypistTech\WPCFG\Vendor\TypistTech\WPContainedHook\Filter;

/**
* Final class Admin.
Expand All @@ -39,8 +39,8 @@ final class Admin implements LoadableInterface
public static function getHooks(): array
{
return [
new Filter(__CLASS__, 'wpcfg_pages', 'addPage'),
new Filter(__CLASS__, 'wpcfg_settings_sections', 'addSettingsSection'),
new Filter('wpcfg_pages', __CLASS__, 'addPage'),
new Filter('wpcfg_settings_sections', __CLASS__, 'addSettingsSection'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/BadLogin/BadLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

namespace TypistTech\WPCFG\BadLogin;

use TypistTech\WPCFG\Action;
use TypistTech\WPCFG\Blacklist\Event;
use TypistTech\WPCFG\Container;
use TypistTech\WPCFG\LoadableInterface;
use TypistTech\WPCFG\OptionStore;
use TypistTech\WPCFG\Vendor\TypistTech\WPContainedHook\Action;

/**
* Final class BadLogin.
Expand Down Expand Up @@ -65,7 +65,7 @@ public function __construct(OptionStore $optionStore, Container $container)
public static function getHooks(): array
{
return [
new Action(__CLASS__, 'wp_authenticate', 'emitBlacklistEventIfBadUsername'),
new Action('wp_authenticate', __CLASS__, 'emitBlacklistEventIfBadUsername'),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Blacklist/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

namespace TypistTech\WPCFG\Blacklist;

use TypistTech\WPCFG\Action;
use TypistTech\WPCFG\Cloudflare\AccessRules;
use TypistTech\WPCFG\LoadableInterface;
use TypistTech\WPCFG\OptionStore;
use TypistTech\WPCFG\Vendor\TypistTech\WPContainedHook\Action;

/**
* Final class Handler.
Expand Down Expand Up @@ -64,7 +64,7 @@ public function __construct(OptionStore $optionStore, AccessRules $accessRules)
public static function getHooks(): array
{
return [
new Action(__CLASS__, 'wpcfg_blacklist', 'handleBlacklist'),
new Action('wpcfg_blacklist', __CLASS__, 'handleBlacklist'),
];
}

Expand Down
Loading