add_inline_css = apply_filters( 'advanced-ads-output-inline-css', true ); if ( ! $this->add_inline_css ) { return; } // Add inline css to the tcf container. $this->check_tcf_option(); } /** * Adds inline css. * * @param array $wrapper Add wrapper array. * @param string $css Custom inline css. * @param bool|null $global_output Whether this ad is using cache-busting. * * @return array */ public function add_css( $wrapper, $css, $global_output ) { $this->add_inline_css = $this->add_inline_css && $global_output !== false; if ( ! $this->add_inline_css ) { return $wrapper; } $styles = $this->get_styles_by_string( $css ); $wrapper['style'] = empty( $wrapper['style'] ) ? $styles : array_merge( $wrapper['style'], $styles ); $this->add_inline_css = false; return $wrapper; } /** * Extend TCF output with a container containing inline css. * * @param string $output The output string. * @param Advanced_Ads_Ad $ad The ad object. * * @return string */ public function add_tcf_container( $output, Advanced_Ads_Ad $ad ) { $inline_css = $ad->options( 'inline-css' ); if ( ! $ad->global_output || empty( $inline_css ) || strpos( $output, '