WC_Email::style_inlinepublicWC 1.0

Apply inline styles to dynamic content.

We only inline CSS for html emails.

Method of the class: WC_Email{}

Returns

String.

Usage

$WC_Email = new WC_Email();
$WC_Email->style_inline( $content );
$content(string|null) (required)
Content that will receive inline styles.

WC_Email::style_inline() code WC 10.8.1

public function style_inline( $content ) {
	if ( in_array( $this->get_content_type(), array( 'text/html', 'multipart/alternative' ), true ) ) {
		/**
		 * Filter to allow the ability to override the email inline styling method.
		 *
		 * @since 10.2.0
		 *
		 * @param callable $style_inline_callback The default email inline styling callback.
		 * @param string|null $content Content that will receive inline styles.
		 * @param WC_Email $email The WC_Email object.
		 */
		$style_inline_callback = apply_filters( 'woocommerce_mail_style_inline_callback', array( $this, 'apply_inline_style' ), $content, $this );

		if ( ! is_callable( $style_inline_callback ) ) {
			$style_inline_callback = array( $this, 'apply_inline_style' );
		}

		return call_user_func( $style_inline_callback, $content );
	}

	return $content;
}