public function _real_escape( $data ) { if ( !
is_scalar( $data ) ) { return '';
} if ( $this->dbh
) { if ( $this->use_mysqli
) { $escaped =
mysqli_real_escape_string( $this->dbh,
$data );
} else { $escaped =
mysql_real_escape_string( $data,
$this->dbh
);
} } else { $class =
get_class( $this );
wp_load_translations_early();
/* translators: %s: Database access abstraction class, usually wpdb or a class extending wpdb. */
_doing_it_wrong( $class,
sprintf( __( '%s must set a database connection for use with escaping.'
),
$class ), '3.6.0'
);
$escaped =
addslashes( $data );
}