A WordPress-centric search engine for devs and theme authors



__get_option ›

Since1.5.1
Deprecatedn/a
__get_option ( $setting )
Access:
  • private
Parameters:
  • (string) $setting Option name.
    Required: Yes
Returns:
  • (mixed)
Defined at:
Codex:

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



Source

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 );
}