Skip to content

Commit

Permalink
Create param filter and format targeting string method to properly lo…
Browse files Browse the repository at this point in the history
…op through targeting parameters.
  • Loading branch information
Matthew Harvey committed Jul 23, 2013
1 parent b294163 commit 8c4aeb1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion providers/doubleclick-for-publishers-async.php
Expand Up @@ -141,7 +141,8 @@ public function filter_output_html( $output_html, $tag_id ) {
$ad_tags = $ad_code_manager->ad_tag_ids;

// Allow users to set targeting parameters
$set_targeting = apply_filters( 'acm_add_set_targets', '' );
$targeting_params_array = apply_filters( 'acm_targeting_params', array() );
$targeting_string = $this->format_targeting_string( $targeting_params_array );

ob_start();
?>
Expand Down Expand Up @@ -208,6 +209,22 @@ public function action_wp_head() {
do_action( 'acm_tag', 'dfp_head' );
}

/**
* Format setTargeting string
* @param array $params_array [description]
* @return string [description]
*/
function format_targeting_string( $params_array = array() ) {
$ret = '';
var_dump($params_array);
// Iterate over array of key value pairs and format a string
foreach( (array) $params_array as $key => $value ) {
echo "$key is $value";
}

return $ret;
}

}

class Doubleclick_For_Publishers_Async_ACM_WP_List_Table extends ACM_WP_List_Table {
Expand Down

0 comments on commit 8c4aeb1

Please sign in to comment.