render_color_css( $primary_color, $secondary_color ); if ( '' === trim( $custom_css ) ) { return; } wp_register_style( 'timetics-custom-css', false, array(), TIMETICS_VERSION ); wp_enqueue_style( 'timetics-custom-css' ); wp_add_inline_style( 'timetics-frontend', $custom_css ); } /** * Render the CSS template with the given colors. * * @param string $primary_color * @param string $secondary_color * * @return string */ protected function render_color_css( $primary_color, $secondary_color ) { if ( ! file_exists( self::COLOR_TEMPLATE ) ) { return ''; } $primary_color = sanitize_hex_color( $primary_color ) ?: $primary_color; $secondary_color = sanitize_hex_color( $secondary_color ) ?: $secondary_color; ob_start(); include self::COLOR_TEMPLATE; return ob_get_clean(); } }