ad = $ad; $this->meta = $meta; $this->wo_meta = $wo_meta; $this->type = $type; } /** * Build the content ad. * * @return string */ public function build_ad() { $key = ( $this->type === 'textcode' ) ? 'adcontent_text' : 'adcontent_rich'; $content = $this->wo_meta->get_value( $this->meta, $key ); if ( $key === 'adcontent_text' ) { $content = str_replace( array( "\r", "\n" ), '', $content ); } return $content; } }