sanitize_option( string $option, mixed $value ): mixed
- Since
- 2.0.5
- Source
wp-includes/formatting.php:4852
Description
This is basically a switch statement which will pass $value through a number of functions depending on the $option.
Compatibility
- WordPress
- since 2.0.5
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$optionstring- The name of the option.
$valuemixed- The unsanitized value.
Return value
mixed- Sanitized value.
Performance profile
How much work a call to sanitize_option() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Moderate
- Scaling
- Constant
- Instructions
- 20–77
- Plugin surface
- 1 hook
- Called by
- 8
Reads stored settings via get_option(), cached per request but not free on a cold cache.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 584.
Third-party callbacks on 'sanitize_option_{$option}' run inside this call, and their cost is not bounded by anything here.
8 places in core call this, so the cost is paid more often than your own code shows.
What it touches
- optionoption read or write
get_option()called directly - hookthird-party callbacks
apply_filters()called directly - cacheobject cache
wp_cache_get()one call below sanitize_option() - serializeserialisation
maybe_unserialize()one call below sanitize_option()
Further down the call graph this can also reach query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 87 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost sanitize_option() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
$error === null | 20–23 | apply_filters() |
$error === null | 21 | absint(), apply_filters() |
$value && $error === null | 26–27 | abs(), apply_filters() |
$error !== null && $error !== "" && !function_exists() | 30–33 | get_option(), function_exists(), apply_filters() |
$error !== null && $error !== "" && !function_exists() | 31 | absint(), get_option(), function_exists(), apply_filters() |
is_wp_error() && $error === null | 32–34 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && !function_exists() | 34–37 | is_wp_error(), get_option(), function_exists(), apply_filters() |
$value === false && !is_wp_error() && $error === null | 35 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), apply_filters() |
!is_wp_error() && !$value && $error === null | 35 | ->strip_invalid_text_for_column(), is_wp_error(), __(), apply_filters() |
!is_wp_error() && $value && $error === null | 35 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_url(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && !function_exists() | 35 | absint(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$error !== null && $error !== "" && function_exists() | 36–39 | get_option(), function_exists(), add_settings_error(), apply_filters() |
75 further outcomes, up to 77 instructions
$value && $error !== null && $error !== "" && !function_exists() | 36–37 | abs(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && is_email() && $error === null | 36 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), apply_filters() |
$error !== null && $error !== "" && function_exists() | 37 | absint(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && $error === null | 37 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && function_exists() | 40–43 | is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value && $error !== null && $error === "" && !is_wp_error() && !function_exists() | 40–41 | abs(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$error === null | 40 | explode(), array_map(), array_filter(), array_map(), array_filter(), apply_filters() |
!is_wp_error() && !is_email() && $error === null | 41 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && function_exists() | 41 | absint(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value && $error !== null && $error !== "" && function_exists() | 42–43 | abs(), get_option(), function_exists(), add_settings_error(), apply_filters() |
is_wp_error() && $error !== null && $error !== "" && !function_exists() | 42–44 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), get_option(), function_exists(), apply_filters() |
$value === false && !is_wp_error() && $error !== null && $error !== "" && !function_exists() | 45 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), get_option(), function_exists(), apply_filters() |
$value !== false && is_wp_error() && $error === null | 45 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), apply_filters() |
!is_wp_error() && !$value && $error !== null && $error !== "" && !function_exists() | 45 | ->strip_invalid_text_for_column(), is_wp_error(), __(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && $value && $error !== null && $error !== "" && !function_exists() | 45 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_url(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && !function_exists() | 45–48 | is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value && $error !== null && $error === "" && !is_wp_error() && function_exists() | 46–47 | abs(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && !is_wp_error() && $error === null | 46 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), apply_filters() |
!is_wp_error() && is_email() && $error !== null && $error !== "" && !function_exists() | 46 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && !function_exists() | 46–48 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && !function_exists() | 46 | absint(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && $error !== null && $error !== "" && !function_exists() | 47 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), get_option(), function_exists(), apply_filters() |
is_wp_error() && $error !== null && $error !== "" && function_exists() | 48–50 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value === false && !is_wp_error() && $error !== null && $error === "" && !function_exists() | 49 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && !$value && $error !== null && $error === "" && !function_exists() | 49 | ->strip_invalid_text_for_column(), is_wp_error(), __(), is_wp_error(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && is_email() && $error !== null && $error === "" && !function_exists() | 50 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$error !== null && $error !== "" && !function_exists() | 50 | explode(), array_map(), array_filter(), array_map(), array_filter(), get_option(), function_exists(), apply_filters() |
$value === false && !is_wp_error() && $error !== null && $error !== "" && function_exists() | 51 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && !$value && $error !== null && $error !== "" && function_exists() | 51 | ->strip_invalid_text_for_column(), is_wp_error(), __(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && $value && $error !== null && $error !== "" && function_exists() | 51 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_url(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && !is_email() && $error !== null && $error !== "" && !function_exists() | 51 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && function_exists() | 51–54 | is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value && $error !== null && $error === "" && is_wp_error() && !function_exists() | 51–52 | abs(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && $error !== null && $error === "" && !function_exists() | 51 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), is_wp_error(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && is_email() && $error !== null && $error !== "" && function_exists() | 52 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && function_exists() | 52–54 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && function_exists() | 52 | absint(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && $error !== null && $error !== "" && function_exists() | 53 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && !function_exists() | 54 | explode(), array_map(), array_filter(), array_map(), array_filter(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$value === false && !is_wp_error() && $error !== null && $error === "" && function_exists() | 55 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && is_wp_error() && $error !== null && $error !== "" && !function_exists() | 55 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && !$value && $error !== null && $error === "" && function_exists() | 55 | ->strip_invalid_text_for_column(), is_wp_error(), __(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && !is_email() && $error !== null && $error === "" && !function_exists() | 55 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$value !== false && !is_wp_error() && $error !== null && $error !== "" && !function_exists() | 56 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), get_option(), function_exists(), apply_filters() |
!is_wp_error() && is_email() && $error !== null && $error === "" && function_exists() | 56 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error !== "" && function_exists() | 56 | explode(), array_map(), array_filter(), array_map(), array_filter(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && !is_email() && $error !== null && $error !== "" && function_exists() | 57 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value && $error !== null && $error === "" && is_wp_error() && function_exists() | 57–58 | abs(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && $error !== null && $error === "" && function_exists() | 57 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
is_wp_error() && $error !== null && $error === "" && !function_exists() | 57–59 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value !== false && $error !== null && $error === "" && !function_exists() | 59 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$value !== false && !is_wp_error() && $error !== null && $error === "" && !function_exists() | 60 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), get_option(), function_exists(), apply_filters() |
$value === false && $error !== null && $error === "" && !function_exists() | 60 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && !is_wp_error() && function_exists() | 60 | explode(), array_map(), array_filter(), array_map(), array_filter(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!$value && $error !== null && $error === "" && !function_exists() | 60 | ->strip_invalid_text_for_column(), is_wp_error(), __(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value !== false && is_wp_error() && $error !== null && $error !== "" && function_exists() | 61 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_wp_error() && !is_email() && $error !== null && $error === "" && function_exists() | 61 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
is_email() && $error !== null && $error === "" && !function_exists() | 61 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value !== false && !is_wp_error() && $error !== null && $error !== "" && function_exists() | 62 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && !function_exists() | 62 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
is_wp_error() && $error !== null && $error === "" && function_exists() | 63–65 | ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && $error !== null && $error === "" && function_exists() | 65 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && !function_exists() | 65 | explode(), array_map(), array_filter(), array_map(), array_filter(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value !== false && !is_wp_error() && $error !== null && $error === "" && function_exists() | 66 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value === false && $error !== null && $error === "" && function_exists() | 66 | ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!$value && $error !== null && $error === "" && function_exists() | 66 | ->strip_invalid_text_for_column(), is_wp_error(), __(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_email() && $error !== null && $error === "" && !function_exists() | 66 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
is_email() && $error !== null && $error === "" && function_exists() | 67 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$error !== null && $error === "" && function_exists() | 68 | ->strip_invalid_text_for_column(), is_wp_error(), strip_tags(), wp_kses_data(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && is_wp_error() && $error !== null && $error === "" && !function_exists() | 70 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$value !== false && $error !== null && $error === "" && !function_exists() | 71 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), apply_filters() |
$error !== null && $error === "" && is_wp_error() && function_exists() | 71 | explode(), array_map(), array_filter(), array_map(), array_filter(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
!is_email() && $error !== null && $error === "" && function_exists() | 72 | ->strip_invalid_text_for_column(), is_wp_error(), sanitize_email(), is_email(), __(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && is_wp_error() && $error !== null && $error === "" && function_exists() | 76 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), ->get_error_message(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
$value !== false && $error !== null && $error === "" && function_exists() | 77 | ->strip_invalid_text_for_column(), wp_encode_emoji(), ->strip_invalid_text_for_column(), is_wp_error(), esc_html(), is_wp_error(), __(), ->get_error_code(), sprintf(), get_option(), function_exists(), add_settings_error(), apply_filters() |
This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 584 | 20–77 | 101 | |
| 8.5 | 584 | 20–77 | 101 | |
| 8.4 | 584 | 20–77 | 101 | 38 fewer instructions than PHP 8.3 |
| 8.3 | 622 | 20–77 | 101 | |
| 8.2 | 622 | 20–77 | 101 | 1 more instruction than PHP 8.1 |
| 8.1 | 621 | 20–77 | 101 | |
| 7.4 | 621 | 20–77 | 101 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 1
One hook fires while sanitize_option() runs, in this order:
- apply_filters( sanitize_option_{$option} )filterline 5126 (+274 into the body)
Filters an option value following sanitization.
Uses · 15
- is_wp_error()Checks whether the given variable is a WordPress Error.
- sanitize_email()Strips out all characters that are not allowable in an email.
- is_email()Verifies that an email is valid.
- __()Retrieves the translation of $text.
- absint()Converts a value to non-negative integer.
- wp_encode_emoji()Converts emoji characters to their equivalent HTML entity.
- esc_html()Escaping for HTML blocks.
- wp_kses_data()Sanitize content with allowed HTML KSES rules.
- sanitize_url()Sanitizes a URL for database or redirect usage.
- get_available_languages()Gets all available languages based on the presence of *.mo and *.l10n.php files in a given directory.
- is_multisite()Determines whether Multisite is enabled.
- get_option()Retrieves an option value based on an option name.
Show all 15
- get_role()Retrieves role object.
- add_settings_error()Registers a settings error to be displayed to the user.
- apply_filters()Calls the callback functions that have been added to a filter hook.
Used by · 8
- add_network_option()Adds a new network option.
- add_option()Adds a new option.
- get_settings_errors()Fetches settings errors registered by add_settings_error().
- populate_options()Create WordPress options and set the default values.
- update_network_option()Updates the value of a network option that was already added.
- update_option()Updates the value of an option that was already added.
- wp_ajax_date_format()Handles formatting a date via AJAX.
- wp_ajax_time_format()Handles formatting a time via AJAX.
Source code
function sanitize_option( $option, $value ) { global $wpdb; $original_value = $value; $error = null; switch ( $option ) { case 'admin_email': case 'new_admin_email': $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value ); if ( is_wp_error( $value ) ) { $error = $value->get_error_message(); } else { $value = sanitize_email( $value ); if ( ! is_email( $value ) ) { $error = __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' ); } } break; case 'thumbnail_size_w': case 'thumbnail_size_h': case 'medium_size_w': case 'medium_size_h': case 'medium_large_size_w': case 'medium_large_size_h': case 'large_size_w': case 'large_size_h': case 'mailserver_port': case 'comment_max_links': case 'page_on_front': case 'page_for_posts': case 'rss_excerpt_length': case 'default_category': case 'default_email_category': case 'default_link_category': case 'close_comments_days_old': case 'comments_per_page': case 'thread_comments_depth': case 'users_can_register': case 'start_of_week': case 'site_icon': case 'fileupload_maxk': $value = absint( $value ); break; case 'posts_per_page': case 'posts_per_rss': $value = (int) $value; if ( empty( $value ) ) { $value = 1; } if ( $value < -1 ) { $value = abs( $value ); } break; case 'default_ping_status': case 'default_comment_status': // Options that if not there have 0 value but need to be something like "closed". if ( '0' === (string) $value || '' === $value ) { $value = 'closed'; } break; case 'blogdescription': case 'blogname': $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value ); if ( $value !== $original_value ) { $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', wp_encode_emoji( $original_value ) ); } if ( is_wp_error( $value ) ) { $error = $value->get_error_message(); } else { $value = esc_html( $value ); } break; case 'blog_charset':Changelog
Introduced in 2.0.5. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, from
src/wp-includes/formatting.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.