What’s the difference between:
bloginfo('name');
vs
get_option('blogname');
The parameter is just an example, but I see no differences in terms displaying what I want.
Are there any particular differences? Or are they just for semantic reasons.
Thanks in advance.
3 Answers
The two functions output exactly the same thing.
From the Codex entry for get_bloginfo()
:
‘name’ – Returns the “Site Title” set in Settings > General. This data is retrieved from the “blogname” record in the wp_options table.
From source:
case 'name':
default:
$output = get_option('blogname');
Neither get_bloginfo()
nor bloginfo()
do any sort of sanitization or escaping; so both get_bloginfo( 'name' )
and get_option( 'blogname' )
return exactly the same value.