You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manage your ad codes through the WordPress admin in a safe and easy way.
12
+
Manage your ad codes through the WordPress admin safely and easily.
13
13
14
14
## Description
15
15
16
16
Ad Code Manager gives non-developers an interface in the WordPress admin for configuring your complex set of ad codes.
17
17
18
-
Some code-level configuration may be necessary to set up Ad Code Manager. Ad tags must be added (via `do_action()`) to your theme's template files where you'd like ads to appear. Alternatively, you can incorporate ad tags into your website with our widget and our shortcode. Check out the configuration guide below for the full details.
18
+
Some code-level configuration may be necessary to set up Ad Code Manager. Ad tags must be added (via `do_action()`) to your theme's template files where you'd like ads to appear. Alternatively, you can incorporate ad tags into your website with our widget and shortcode. Check out the configuration guide below for the full details.
19
19
20
-
A common set of parameters must also be defined for your ad provider. This includes the tag IDs used by your template, the default URL for your ad provider, and the default HTML surrounding that URL. Ad Code Manager comes with support for Google Doubleclick For Publishers (and Async), and Google AdSense. All the logic is abstracted, however, so configuring a different provider is relatively easy. Check `providers/doubleclick-for-publishers.php` for an idea of how to extend ACM to suit your needs.
20
+
A common set of parameters must also be defined for your ad provider. This includes the tag IDs used by your template, the default URL for your ad provider, and the default HTML surrounding that URL. Ad Code Manager supports Google DoubleClick For Publishers (and Async), and Google AdSense. All the logic is abstracted, however, so configuring a different provider is relatively easy. Check `providers/doubleclick-for-publishers.php` for an idea of how to extend ACM to suit your needs.
21
21
22
-
Once this configuration is in place, the Ad Code Manager admin interface will allow you to add new ad codes, modify the parameters for your script URL, and define conditionals to determine when the ad code appears. Conditionals are core WordPress functions like is_page(), is_category(), or your own custom functions that evaluate certain expression and then return true or false.
22
+
Once this configuration is in place, the Ad Code Manager admin interface will allow you to add new ad codes, modify the parameters for your script URL, and define conditionals to determine when the ad code appears. Conditionals are core WordPress functions like is_page(), is_category(), or your own custom functions that evaluate certain expressions and then return true or false.
23
23
24
24
[Fork the plugin on Github](https://github.com/Automattic/Ad-Code-Manager) and [follow our development blog](http://adcodemanager.wordpress.com/).
25
25
26
26
## Installation
27
27
28
-
The plugin requires PHP 7.4 or later. It is also test on WordPress 5.7 and later, though it may run on older versions.
28
+
The plugin requires PHP 7.4 or later. It is also tested WordPress 5.7 and later, though it may run on older versions.
29
29
30
30
Since the plugin is in its early stages, there are a couple additional configuration steps:
31
31
32
32
1. Upload `ad-code-manager` to the `/wp-content/plugins/` directory.
33
33
2. Activate the plugin through the 'Plugins' menu in WordPress.
34
-
3. Incorporate ad tags in your theme template with `do_action( 'acm_tag', 'slot' )`. Also you can use `[acm-tag id="slot"]` shortcode or ACM Widget.
34
+
3. Incorporate ad tags in your theme template with `do_action( 'acm_tag', 'slot' );`. Also, you can use `[acm-tag id="slot"]` shortcode or ACM Widget.
35
35
4. Implement filters to make the plugin work with your provider.
36
36
5. Configure your ad codes in the WordPress admin (Tools -> Ad Code Manager).
37
37
@@ -51,11 +51,11 @@ Since the plugin is in its early stages, there are a couple additional configura
51
51
52
52
## Configure Ad Code Manager to manage the advertisements on your site
53
53
54
-
Ad Code Manager is a VIP-sponsored plugin designed to make it easier to manage the ad codes used to display advertisements on your site. There's a little bit of work you'll need to do up front, however, in order to integrate Ad Code Manager with your theme.
54
+
Ad Code Manager is a VIP-sponsored plugin designed to make managing the ad codes used to display advertisements on your site easier. There's a little bit of work you'll need to do upfront to integrate Ad Code Manager with your theme.
55
55
56
-
The high-level idea behind Ad Code Manager is that it gives non-developers an admin interface to manage your ad codes. It then permits users to (optionally) target specific ad codes using conditionals like `is_home()` and `is_single()`. Ad codes are associated with positions in the theme through the use of ad tags.
56
+
The high-level idea behind Ad Code Manager is that it gives non-developers an admin interface to manage ad codes. It then permits users to (optionally) target specific ad codes using conditionals like `is_home()` and `is_single()`. Ad codes are associated with positions in the theme through the use of ad tags.
57
57
58
-
Currently, Ad Code Manager easily integrates with Google Doubleclick For Publishers Async and Google AdSense. Other ad providers are supported with additional configuration.
58
+
Currently, Ad Code Manager easily integrates with Google DoubleClick For Publishers Async and Google AdSense. Other ad providers are supported with additional configuration.
59
59
60
60
### Google AdSense and DoubleClick For Publishers Async
61
61
@@ -65,11 +65,11 @@ Let's use AdSense as our first example. You'll want to incorporate some of the d
65
65
do_action( 'acm_tag', '728x90_leaderboard' );
66
66
~~~
67
67
68
-
Once you've done so, you can select the "Google AdSense" provider in the admin. Ad codes can be registered against ad tags (positions) by choosing the ad tag from the dropdown, entering the tag ID and publisher ID, and hitting "Add New Ad Code".
68
+
Once done, you can select the "Google AdSense" provider in the admin. Ad codes can be registered against ad tags (positions) by choosing the ad tag from the drop-down, entering the tag ID and publisher ID, and hitting "Add New Ad Code".
69
69
70
70
And like that, your 728x90 leaderboard will appear on your site.
71
71
72
-
The Google AdSense configuration comes with many of Google's suggested sizes. Additional ad tags can be registered by the way of filtering:
72
+
The Google AdSense configuration comes with many of Google's suggested sizes. Additional ad tags can be registered by way of filtering:
@@ -88,13 +88,13 @@ function acmx_filter_ad_tag_ids( $ids ) {
88
88
}
89
89
~~~
90
90
91
-
Keep in mind that you'll still need to incorporate a `do_action( 'acm_tag', '100x100_smallsquare' );` in your theme in order to display the ad tag.
91
+
Keep in mind that you'll still need to incorporate a `do_action( 'acm_tag', '100x100_smallsquare' );` in your theme to display the ad tag.
92
92
93
93
If you choose Google DFP Async as your provider, you'll likely need to register additional ad tags, as we only package two default ad tags.
94
94
95
95
### Custom Ad Provider Implementations
96
96
97
-
As mentioned previously, other ad code providers are supported with additional configuration. Here's an example of the different filters you would use to configure the older version of Google Doubleclick For Publishers:
97
+
As mentioned previously, other ad code providers are supported with additional configuration. Here's an example of the different filters you would use to configure the older version of Google DoubleClick For Publishers:
98
98
99
99
~~~php
100
100
/**
@@ -240,10 +240,10 @@ There are some filters which allow you to easily customize the output of the plu
240
240
241
241
### `acm_ad_tag_ids`
242
242
243
-
Ad tag ids are used as a parameter when adding tags to your theme (e.g. `do_action( 'acm_tag', 'my_top_leaderboard' )`). The `url_vars` defined as part of each tag here will also be used to replace tokens in your default URL.
243
+
Ad tag IDs are used as a parameter when adding tags to your theme (e.g. `do_action( 'acm_tag', 'my_top_leaderboard' )`). The `url_vars` defined as part of each tag here will also be used to replace tokens in your default URL.
244
244
245
245
Arguments:
246
-
* array $tag_ids array of default tag ids
246
+
* array $tag_ids array of default tag IDs
247
247
248
248
Example usage: Add a new ad tag called 'my_top_leaderboard'
249
249
@@ -267,7 +267,7 @@ function my_acm_ad_tag_ids( $tag_ids ) {
267
267
Set the default tokenized URL used when displaying your ad tags. This filter is required.
268
268
269
269
Arguments:
270
-
* string $url The tokenized url of Ad Code
270
+
* string $url The tokenized URL of Ad Code
271
271
272
272
Example usage: Set your default ad code URL
273
273
@@ -282,7 +282,7 @@ function my_acm_default_url( $url ) {
282
282
283
283
### `acm_output_html`
284
284
285
-
The HTML outputted by the `do_action( 'acm_tag', 'ad_tag_id' );` call in your theme. Support multiple ad formats (e.g. JavaScript ad tags, or simple HTML tags) by adjusting the HTML rendered for a given ad tag.
285
+
The HTML outputted by the `do_action( 'acm_tag', 'ad_tag_id' );` call in your theme. Support multiple ad formats (e.g. JavaScript or simple HTML tags) by adjusting the HTML rendered for a given ad tag.
286
286
287
287
The `%url%` token used in this HTML will be filled in with the URL defined with `acm_default_url`.
288
288
@@ -311,7 +311,7 @@ function my_acm_output_html( $output_html, $tag_id ) {
311
311
312
312
### `acm_register_provider_slug`
313
313
314
-
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.
314
+
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 using the `acm_register_provider_slug` filter to register those that may be included as part of your theme or another plugin.
315
315
316
316
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.
317
317
@@ -339,7 +339,7 @@ A security filter to define a safelist for which ad code script URLs can be adde
339
339
Arguments:
340
340
* array $whitelisted_urls Existing whitelisted ad code URLs
341
341
342
-
Example usage: Allow Doubleclick for Publishers ad codes to be used
342
+
Example usage: Allow DoubleClick for Publishers ad codes to be used
@@ -351,11 +351,11 @@ function my_acm_safelisted_script_urls( $safelisted_urls ) {
351
351
352
352
### `acm_output_tokens`
353
353
354
-
Output tokens can be registered depending on the needs of your setup. Tokens defined here will be replaced in the ad tag's tokenized URL in addition to the tokens already registered with your tag id.
354
+
Output tokens can be registered depending on the needs of your setup. Tokens defined here will be replaced in the ad tag's tokenized URL in addition to the tokens already registered with your tag ID.
355
355
356
356
Arguments:
357
357
* array $output_tokens Any existing output tokens
358
-
* string $tag_id Unique tag id
358
+
* string $tag_id Unique tag ID
359
359
* array $code_to_display Ad Code that matched conditionals
360
360
361
361
Example usage: Test to determine whether you're in test or production by passing ?test=on query argument
By default, we use our bundled doubleclick_for_publishers config (check it in `/providers/doubleclick-for-publishers.php`). If you want to add your own flavor of DFP or even implement configuration for some another ad network, you'd have to apply a filter to correct the slug.
436
+
By default, we use our bundled doubleclick_for_publishers config (check it in `/providers/doubleclick-for-publishers.php`). If you want to add your own flavor of DFP or even implement configuration for another ad network, you'd have to apply a filter to correct the slug.
437
437
438
438
Example usage:
439
439
@@ -448,8 +448,8 @@ add_filter(
448
448
449
449
### `acm_logical_operator`
450
450
451
-
By default, logical operator is set to "OR", that is, ad code will be displayed if at least one conditional returns true.
452
-
You can change it to "AND", so that ad code will be displayed only if ALL of the conditionals match.
451
+
By default, the logical operator is set to "OR", that is, ad code will be displayed if at least one conditional returns true.
452
+
You can change it to "AND", so that the ad code will be displayed only if ALL the conditionals match.
453
453
454
454
Example usage:
455
455
@@ -464,7 +464,7 @@ add_filter(
464
464
465
465
### `acm_manage_ads_cap`
466
466
467
-
By default, user has to have `manage_options` cap. This filter comes in handy, if you want to relax the requirements.
467
+
By default, the user has to have `manage_options` cap. This filter comes in handy if you want to relax the requirements.
468
468
469
469
Example usage:
470
470
@@ -479,7 +479,7 @@ add_filter(
479
479
480
480
### `acm_allowed_get_posts_args`
481
481
482
-
This filter is only for edge cases. Most likely you won't have to touch it. Allows to include additional query args for `Ad_Code_Manager->get_ad_codes()` method.
482
+
This filter is only for edge cases. Most likely, you won't have to touch it. Allows to include additional query args for `Ad_Code_Manager->get_ad_codes()` method.
483
483
484
484
Example usage:
485
485
@@ -494,7 +494,7 @@ add_filter(
494
494
495
495
### `acm_ad_code_count`
496
496
497
-
By default, the total number of ad codes to get is 50, which is reasonable for any small to mid-sized site. However, in some certain cases you would want to increase the limit. This will affect `Ad_Code_Manager->get_ad_codes()` `numberposts` query argument.
497
+
By default, the total number of ad codes to get is 50, which is reasonable for any small to mid-sized site. However, in certain cases, you would want to increase the limit. This will affect `Ad_Code_Manager->get_ad_codes()` `numberposts` query argument.
498
498
499
499
Example usage:
500
500
@@ -529,7 +529,7 @@ function my_acm_list_table_columns( $columns ) {
529
529
530
530
### `acm_ad_code_args`
531
531
532
-
This filter comes in pair with previous one, it should return array of ad networkspecific parameters. E.g. in `acm_list_table_columns` example we have 'id', 'name', 'priority', 'conditionals'. All of them except 'name' are generic for Ad Code Manager. Hence, `acm_provider_columns` should return only "name".
532
+
This filter comes in pair with the previous one. It should return an array of ad network-specific parameters. E.g. in `acm_list_table_columns` example, we have 'id', 'name', 'priority', and 'conditionals'. All of them except 'name' are generic for Ad Code Manager. Hence, `acm_provider_columns` should return only "name".
533
533
534
534
"editable" and "required" indicate whether this field should be editable and required.
Copy file name to clipboardExpand all lines: src/UI/class-contextual-help.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -50,10 +50,10 @@ public function render( WP_Screen $screen ): void {
50
50
51
51
ob_start();
52
52
?>
53
-
<p><?phpesc_html_e( 'Choose the ad network you use, and you will see a set of required fields to fill in, such as IDs. You can also set conditionals for each ad tag, which restricts the contexts for when the adverts are displayed. Priorities work pretty much the same way they work in WordPress. Lower numbers correspond with higher priority.', 'ad-code-manager' ); ?></p>
53
+
<p><?phpesc_html_e( 'Choose your ad network, and you will see a set of required fields to fill in, such as IDs. You can also set conditionals for each ad tag, which restricts the contexts for displaying the adverts. Priorities work pretty much the same way they work in WordPress. Lower numbers correspond with higher priority.', 'ad-code-manager' ); ?></p>
54
54
<p><?phpesc_html_e( 'Once you\'ve finished creating the ad codes, you can display them in your theme using:', 'ad-code-manager' ); ?></p>
55
55
<ul>
56
-
<li><?phpechowp_kses_post( __( 'a template tag in your theme: <code><?php do_action( \'acm_tag\', $tag_id ) ?></code>', 'ad-code-manager' ) ); ?></li>
56
+
<li><?phpechowp_kses_post( __( 'a template tag in your theme: <code><?php do_action( \'acm_tag\', $tag_id ); ?></code>', 'ad-code-manager' ) ); ?></li>
57
57
<li><?phpechowp_kses_post( __( 'a shortcode: <code>[acm-tag id="tag_id"]</code>', 'ad-code-manager' ) ); ?></li>
58
58
<li><?phpesc_html_e( 'or using a widget.', 'ad-code-manager' ); ?></li>
59
59
</ul>
@@ -63,13 +63,13 @@ public function render( WP_Screen $screen ): void {
63
63
ob_start();
64
64
?>
65
65
<p><?phpesc_html_e( 'In the fields below, you can choose which conditionals you want. Some can take a value (i.e. define a specific category) in the second field.', 'ad-code-manager' ); ?></p>
66
-
<p><?phpesc_html_e( 'Here\'s an overview of the conditionals - they work the same as the functions of the same name in WordPress.', 'ad-code-manager' ); ?></p>
66
+
<p><?phpesc_html_e( 'Here\'s an overview of the conditionals; they work the same as the functions of the same name in WordPress.', 'ad-code-manager' ); ?></p>
<dd><?phpechowp_kses_post( __( 'When the main blog page is being displayed. This is the page which shows the timebased blog content of your site, so if you\'ve set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the "Posts page" in <i>Settings > Reading</i>.', 'ad-code-manager' ) ); ?></dd>
69
+
<dd><?phpechowp_kses_post( __( 'When the main blog page is being displayed. This is the page which shows the time-based blog content of your site, so if you\'ve set a static Page for the Front Page (see below), then this will only be true on the Page which you set as the "Posts page" in <i>Settings > Reading</i>.', 'ad-code-manager' ) ); ?></dd>
<dd><?phpechowp_kses_post( __( 'When the front of the site is displayed, whether it is posts or a Page. Returns true when the main blog page is being displayed and the <i>Settings > Reading > Front page displays</i> is set to "Your latest posts", <b>or</b> when <i>Settings</a> > Reading > Front page displays</i> is set to "A static page" and the "Front Page" value is the current Page being displayed.', 'ad-code-manager' ) ); ?></dd>
72
+
<dd><?phpechowp_kses_post( __( 'When the front of the site is displayed, whether it is posts or a Page. Returns true when the main blog page is being displayed and the <i>Settings > Reading > Front page displays</i> is set to "Your latest posts", <b>or</b> when <i>Settings</a> > Reading > Front page displays</i> is set to "A static page" and the "Front Page" value is the current page displayed.', 'ad-code-manager' ) ); ?></dd>
0 commit comments