floatval on output value | WordPress.org

[ad_1]

First time with this one…absint is usable, but this is for absolute numbers, not decimals.

I have an output from a customizer range slider control (decimal values), but to output the value in an inline stylesheet, I’m curious if this line is correct, or is there an alternative for escaping?

$site_title_font_size = floatval(get_theme_mod( 'site_title_font_size' ));

or…

$site_title_font_size = floatval( esc_attr(get_theme_mod( 'site_title_font_size' ) ));

or…?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer