WordPress at a glance
function is not described

__get_option() WP 1.5.1

Utility version of get_option that is private to installation/upgrade.

No Hooks.

Return

Mixed.

Usage

__get_option( $setting );
$setting(string) (required)
Option name.

Notes

  • Global. wpdb. $wpdb

Changelog

Since 1.5.1 Introduced.

Code of get option: wp-admin/includes/upgrade.php WP 5.2.2

<?php
function __get_option( $setting ) {
	global $wpdb;

	if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
		return untrailingslashit( WP_HOME );
	}

	if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
		return untrailingslashit( WP_SITEURL );
	}

	$option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) );

	if ( 'home' == $setting && '' == $option ) {
		return __get_option( 'siteurl' );
	}

	if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting ) {
		$option = untrailingslashit( $option );
	}

	return maybe_unserialize( $option );
}