What does the raw value for the get_bloginfo’s filter argument exactly do?

The $filter argument for the get_bloginfo function has a default value of raw but WordPress’ Code Reference didn’t mention another allowed values. What this raw stands for and what are other possible values if any?

1 Answer
1

We have the following filters added by default (source)

add_filter( 'bloginfo', 'wptexturize'   );
add_filter( 'bloginfo', 'convert_chars' );
add_filter( 'bloginfo', 'esc_html'      );

The bloginfo filter (source) is applied on the get_bloginfo() output, in the display mode, except for the url that has it’s own bloginfo_url filter. The core isn’t using that url filter currently and there’s a wontfix (see #26803) on escaping the url in display mode.

So the raw mode, skips these filters.

The bloginfo() function is a wrapper for get_bloginfo() in display mode (source).

Leave a Comment