Skip to content

Commit 342131c

Browse files
committed
Documentation for acm_register_provider_slug
The last commit did not contain any updated documentation for the Readme file. This adds that. Also, correct the broken array in the code example for acm_ad_tag_ids Issue #33
1 parent 9b097e1 commit 342131c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

readme.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ function my_acm_ad_tag_ids( $tag_ids ) {
5454
'sz' => '728x90', // %sz% token
5555
'fold' => 'atf', // %fold% token
5656
'my_custom_token' => 'something' // %my_custom_token% will be replaced with 'something'
57-
);
57+
),
58+
);
5859
return $tag_ids;
5960
}`
6061

@@ -101,6 +102,26 @@ function my_acm_output_html( $output_html, $tag_id ) {
101102
return $output_html;
102103
}`
103104

105+
= acm_register_provider_slug =
106+
107+
Ad Code Manager has a built in list of providers that it gathers by scanning the 'providers' directory used by the plugin. Additional providers can be added by placing the appropriate files in that directory, or by using the `acm_register_provider_slug` filter to register those that may be included as part of your theme or another plugin.
108+
109+
When using this plugin, you are defining the provider slug as part of the existing object as well as an array of classes associated with that provider slug.
110+
111+
Arguments:
112+
* object $providers An object containing the current registered providers.
113+
114+
Example usage:
115+
116+
`add_filter( 'acm_register_provider_slug', 'my_acm_register_provider_slug' );
117+
function my_acm_register_provider_slug( $providers ) {
118+
$providers->new_provider_slug = array(
119+
'provider' => 'My_New_Ad_Company_ACM_Provider',
120+
'table' => 'My_New_Ad_Company_ACM_WP_List_Table'
121+
);
122+
return $providers;
123+
}`
124+
104125
= acm_whitelisted_script_urls =
105126

106127
A security filter to whitelist which ad code script URLs can be added in the admin

0 commit comments

Comments
 (0)