Permalink
Browse files

Merge branch 'master' of github.com:Automattic/Ad-Code-Manager

  • Loading branch information...
2 parents cf65291 + b243021 commit b3ea1e16cd6ce669662e8e20e389db818e027b4d @rinatkhaziev rinatkhaziev committed Apr 16, 2013
View
@@ -224,15 +224,15 @@ function get_options() {
$default_provider = 'doubleclick_for_publishers';
// Make sure our default provider exists. Otherwise, the sky will fall on our head
if ( ! isset( $this->providers->$default_provider ) ) {
- foreach( $this->providers as $slug => $provider ) {
+ foreach ( $this->providers as $slug => $provider ) {
$default_provider = $slug;
break;
}
}
$defaults = array(
- 'provider' => $default_provider,
- );
+ 'provider' => $default_provider,
+ );
$options = get_option( 'acm_options', array() );
return array_merge( $defaults, $options );
}
@@ -336,7 +336,7 @@ function handle_admin_action() {
break;
case 'update_options':
$options = $this->get_options();
- foreach( $options as $key => $value ) {
+ foreach ( $options as $key => $value ) {
if ( isset( $_REQUEST[$key] ) )
$options[$key] = sanitize_text_field( $_REQUEST[$key] );
}
@@ -639,7 +639,7 @@ function parse_readme_into_contextual_help() {
if ( 5 > count( $sections ) )
return;
- $useful = array( $sections[3], $sections[2], $sections[4] );
+ $useful = array( $sections[2], $sections[4], $sections[7] );
foreach ( $useful as $i => $tab ) {
// Because WP.ORG Markdown has a different flavor
$useful[$i] = Markdown( str_replace( array( '= ', ' =' ), '**', $tab ) );
@@ -651,7 +651,7 @@ function contextual_help() {
global $pagenow;
if ( 'tools.php' != $pagenow || !isset( $_GET['page'] ) || $_GET['page'] != $this->plugin_slug )
return;
- list( $installation, $description, $configuration ) = $this->parse_readme_into_contextual_help();
+ list( $description, $configuration, $filters ) = $this->parse_readme_into_contextual_help();
ob_start();
?>
<div id="conditionals-help">
@@ -690,16 +690,16 @@ function contextual_help() {
);
get_current_screen()->add_help_tab(
array(
- 'id' => 'acm-install',
- 'title' => 'Installation',
- 'content' => $installation,
+ 'id' => 'acm-config',
+ 'title' => 'Configuration',
+ 'content' => $configuration,
)
);
get_current_screen()->add_help_tab(
array(
- 'id' => 'acm-config',
- 'title' => 'Configuration',
- 'content' => $configuration,
+ 'id' => 'acm-filters',
+ 'title' => 'Configuration Filters',
+ 'content' => $filters,
)
);
get_current_screen()->add_help_tab(
@@ -805,7 +805,7 @@ function register_ad_codes( $ad_codes = array() ) {
/**
* 'enable_ui_mapping' is a special argument which means this ad tag can be
* mapped with ad codes through the admin interface. If that's the case, we
- * want to make sure those ad codes are only registered with the tag.
+ * want to make sure those ad codes are only registered with the tag.
*/
if ( isset( $default_tag['enable_ui_mapping'] ) && $default_tag['tag'] != $ad_code['url_vars']['tag'] )
continue;
@@ -836,6 +836,14 @@ function register_ad_codes( $ad_codes = array() ) {
* @param string $tag_id Unique ID for the ad tag
*/
function action_acm_tag( $tag_id ) {
+ /**
+ * See http://adcodemanager.wordpress.com/2013/04/10/hi-all-on-a-dotcom-site-that-uses/
+ *
+ * Configuration filter: acm_disable_ad_rendering
+ * Should be boolean, defaulting to disabling ads on previews
+ */
+ if ( apply_filters( 'acm_disable_ad_rendering', is_preview() ) )
+ return;
$code_to_display = $this->get_matching_ad_code( $tag_id );
@@ -228,7 +228,7 @@ function column_id( $item ) {
$ad_code_arg = array_shift( wp_filter_object_list( $ad_code_args, array( 'key' => $slug ) ) );
if ( isset( $ad_code_arg['type'] ) && 'select' == $ad_code_arg['type'] ) {
$output .= '<select name="' . esc_attr( $column_id ) . '">';
- foreach( $ad_code_arg['options'] as $key => $label ) {
+ foreach ( $ad_code_arg['options'] as $key => $label ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $value, $key, false ) . '>' . esc_attr( $label ) . '</option>';
}
$output .= '</select>';
@@ -347,4 +347,4 @@ function inline_edit() {
<?php
}
-}
+}
Oops, something went wrong.

3 comments on commit b3ea1e1

Collaborator

danielbachhuber replied Apr 16, 2013

@rinatkhaziev can you make sure you git pull --rebase when you update to avoid these commits? there's no harm in doing it all the time

Collaborator

rinatkhaziev replied Apr 16, 2013

Honestly, I wasn't even aware of --rebase arg. Will do. Thanks

Collaborator

danielbachhuber replied Apr 16, 2013

Yep, it replays commits and places yours in the proper place

Please sign in to comment.