It’s debatable whether the name Ernest, used punningly by Wilde in his most famous play The Importance of Being Earnest, was chosen as a late Victorian code word for “gay”.
For instance, the Wildean academic, John Stokes, suggests here this may be true “since the word ‘Earnest’ bears a euphonious relation to the [gender-variant] term Uranian”—presumably in the sound of its continental equivalents. 
On the other hand, the actor, Sir Donald Sinden, who both knew and consulted Lord Alfred Douglas and Sir John Gielgud on the point, once wrote to The Times to dispute the suggestion. 
However, whether the words Ernest and Earnest are homosexual or merely homophonic, one thing is clear.
The choice of names, and particularly the name Ernest, formed part of a gay literary subtext close to Wilde in the 1890s.
Ernest, In Earnest
The intrigue begins with gay writer John Gambril Nicholson‘s 1892 book of poetry: Love in Earnest: Sonnets, Ballades, and Lyrics (Elliot Stock, 1892)—which is a hyperbolic (and eventually interminable) series of same-sex lovelorn verse.
We focus on one particular ballad therein entitled Of Boys’ Names which contains the famous refrain:
“And Ernest sets my heart a-flame”.
The reference to an Ernest in Nicholson can be traced via Frankel, Edmonds, McKenna, The Daily Telegraph, and Timothy d’Arch Smith’s study of Uranian love in 1970 , all the way back to John Addington Symonds—Wilde’s associate and poet of l’amour de l’impossible. Symonds wrote to a friend soon after the poem’s release saying, “Have you read a volume of Sonnets called ‘Love in Earnest’? It is written by a Schoolmaster in love with a boy called Ernest”.
Indeed, it was. The dedicatee of the poem being “W. E. M.”: one William Ernest Mather—but more of him later. For now, we have the name Ernest in a gay subculture piece of verse collected under the title ‘Love in Earnest‘ and this is sufficient to establish the homoerotic credentials of Nicholson’s homophone.
But what is the Wildean connection?
Of Boys’ Names
The first point to note, and what none of the above sources mentions, are the other names in Nicholson’s poem that also have Wildean parallels.
One of the reasons why this little curiosity has rarely, if ever, been cited is that Nicholson’s poem is never given in full.
So, let us rescue it from obscurity for a closer look:
The names with Wilde connections are Bernard (Shaw), Leonard (Smithers), Lionel (Johnson), Stephan-e (Mallarme), Frank (Harris), Herbert (Beerbohm Tree), and possibly others.
Ah but! you will say, those are all commonplace names whose occurrence might easily be coincidental. Besides, they are not all homosexual men. So let us not get carried away with gay abandon just yet. Neither let the conspiracists think that Nicholson’s allusion to “deathless wreaths of asphodel” echoes Dorian Gray (ch. VIII) where Lord Henry said he had buried his romance in a bed of the same yellowy perennial. Nor yet allow the imaginative to think that the line “My little Prince” is perhaps suggestive of Wilde’s fairy tales. All of these allusions can be planted behind the grassy knoll where, if you say so, they belong.
But what I find too coincidental to dispense with are two further names in the poem. And it’s not just that these names are more unusual and, therefore, less coincidental. It is that they happen to be, no less, the two names of Wilde’s own sons: Cyril and Vivian. Surely, their inclusion should give us pause to wonder how this might have come about?
Two possibilities emerge. Either Wilde was around Nicholson and suggested them; or Nicholson, perhaps in homage, is directly referencing Wilde’s dialogue The Decay of Lying in which the interlocutors have those names so spelled.
But there’s more.
Research now leads me to a further connection.
In 1978 a new version of Love in Earnest came to light in a Cambridge (UK) bookshop—causing some interest among bibliophiles, and leading to an article in the journal The Book Collector (Summer, 1978).
The article in The Book Collector makes some intriguing revelations.
We learn that although Love In Earnest ran to only one edition, there were in fact, two issues. The first is scarce and unviewed, and the second is the one from which the copy of the poem above is taken (viewable in full here).
But there was an intermediary version that differs from the other two—it is Nicholson’s own copy, which is the one discovered in 1978.
This version, possibly unique, is a hybrid of both issues extensively annotated by Nicholson. His manuscript notes include minutiae about the date, place and often the time of day of composition, together with other symbols and emendations.
From Nicholson’s copy we discover the changes he made from the first issue. A key change for us is that the reference to Cyril (one of Wilde’s two sons) appears only in the second issue. We find that in the wording “Cyril is lordly” was in fact a substitute for the original “Basil is kingly”. 
This, of course, provides us with yet another obviously Wildean name: that of Basil Hallward, the painter in Wilde’s The Picture of Dorian Gray published in book form a year earlier. Moreover, and intriguingly, the textual alteration in the annotated hybrid version is possibly in a hand other than Nicholson’s. More intriguing still is the relevant gloss, “Correction in Jackson’s copy”, meaning fellow Uranian poet Charles Kaines Jackson to whom Nicholson had turned for legal advice about another amended poem in the anthology. Perhaps Jackson (and/or Wilde?) wished to distance the poem from the current scandal over the characters in Dorian Gray?
In any event, Cyril and Vivian connect Wilde beyond a reasonable doubt to the Nicholson poem. We should now seek to connect him to Nicholson the poet.
I hold it to be noble
Love in Earnest was published in 1892, the year that Wilde first met gay activist George Ives at the Authors’ Club in London. Ives went on to found a secret society for homosexuals called the Order of Chaeronea, of which Nicholson and many other of Wilde friends were members.
Shortly after this at George Ives’ rooms at the Albany (the Albany being where Ernest resides in Earnest) Wilde met John Francis Bloxam, another Uranian undergraduate at Exeter College, Oxford. Bloxam was in the process of editing and seeking contributions for a college journal entitled The Chameleon—which eventually appeared in 1894.
The Chameleon—a creature symbolic of hiding in plain sight—ran to one notorious issue of 100 copies. But what an issue!
This obscure single issue of a university journal casts a long shadow.
Signed only as “X”, Bloxam published his own notoriously homoerotic story The Priest and the Acolyte which Wilde later (and probably disingenuously) had to distance himself from in court. The story concerns a suicide pact and final kiss between the two male protagonists. It almost proved to be a poisoned chalice for Wilde, as well, but the prosecuting counsel was unaware of the anonymous author and therefore saw no suspicious kinship when Wilde’s cleverly inserted a Lady Bloxham in his Earnest play—she being someone we never see with no guarantee of character, these days.
Also in that lone issue of The Chameleon is the debut of Alfred Douglas‘ poem Two Loves with its famous gay mantra “I am the love that dare not speak its name” something Wilde also found himself having to explain (magnificently) under cross-examination.
And then, side-by-side in the Chameleon are the submissions of Wilde and Nicholson. They must, by now, have surely known each other.
Appearing first, and at the prompting of Douglas, Wilde contributed his pithy Phrases and Philosophies for the Use of the Young which, three months before his trial, contains the prophetic dictum: It is only the superficial qualities that last. Man’s deeper nature is soon found out.
Nicholson follows Wilde with a dreamy prose/poem of trademark lovelorn ruin under the title The Shadow of the End. The story exemplifies the unifying theme of the Chameleon: that of shadow and shame, love and fatalism.
Only when we reach the last contribution Dawn does love become a “beauteous thing”. In this poem Bloxham (writing under his pseudonym of Bertram Lawrence) clasps to his breast “my sweet boy-king”.
So who was Ernest?
Going back to the anthology Love in Earnest, Nicholson dedicated the poem Of Boys’ Names to a “W.E.M.”: the flaxen-haired, blue-eyed William Ernest Mather (1877–99).
This identification used to be unknown. Then it was speculated upon. But any doubt about it was laid to rest also by the discovery of Nicholson’s own copy of Love in Earnest, because, tipped in to face the title page there is a photograph, taken in Llandudno, of Nicholson together with William Ernest Mather.
The image is quite rare, e.g. no example has been found online. However, it is reproduced in the issue of The Book Collector now discussed (p. 220). It was taken by Adrian Smythe (photographer, Llandudno) in June 1889, and in it the two are standing facing each other with Nicholson clasping the younger Mather’s hands in his own.
An Earnest Observation
In addition to the dedication “W.E.M.” in the printed edition, Nicholson makes frequent manuscript references, in his copy, not only to “W.E.M.”, but also to “E.S”, identified in another manuscript note as Ernest Stanley. Presumably this is the second Ernest that Nicholson references in his semi-autobiographical but innocuous novel “The Romance of a Choir-boy” (1916) in which he describes photographs of two boys called Ernest.
Which tells me that Nicholson, like Bloxam, was the one with the obsession; just as Ives, like Douglas, was the one with the cause. Survivors of the struggle all four. While Oscar, quietly camping somewhere near the battlefield was mortally wounded when he went over to see what all the fuss was about.
© John Cooper
With thanks to 1890s expert Michael Seeney for suggesting minor alterations which have been made to the original text of this article.
 Uranian. The term was first published by activist Karl Heinrich Ulrichs (1825–95) who derived the word from the Greek goddess Aphrodite Urania, who was created out of the god Uranus’ testicles. (Wikipedia). The German urning and the French Uraniste (pronounced urniste) are equivalents.
 The Times, February 2, 2001, p. 19.
 Love in Earnest: some notes on the lives and writings of English ‘Uranian’ poets from 1889 to 1930. Timothy D’Arch Smith, Routledge & K. Paul, 1970.
 Wordsmiths will no doubt also recognize that “Basil is kingly” is also a literal allusion: the word Basil in Greek (basileus) means royal. And, similarly, most of the other names in the poem are accompanied by suggestions of their etymological roots.