Skip to content

Commit 9b097e1

Browse files
committed
Add filter to enable registration of external providers
This commit adds a filter - 'acm_register_provider_slug' - that enables a file included from a directory outside of the standard Ad Code Manager structure to be used as the provider extension class. We pass the existing provider data collected and allow another provider slug to be set with associated class information. Closes #33
1 parent 14b9127 commit 9b097e1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ad-code-manager.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ function action_load_providers() {
115115

116116
}
117117

118+
/**
119+
* Configuration filter: acm_register_provider_slug
120+
*
121+
* We've already gathered a list of default providers by scanning the ACM plugin
122+
* directory for classes that we can use. To add a provider already included via
123+
* a different directory, the following filter is provided.
124+
*/
125+
$this->providers = apply_filters( 'acm_register_provider_slug', $this->providers );
126+
118127
/**
119128
* Configuration filter: acm_provider_slug
120129
*

0 commit comments

Comments
 (0)