That was about Kaiser Wilhelm II, who visited Jerusalem in 1898. I found a similar tale mentioned, but I suspect those stories have originated from fake accounts as the visit was the cause of some mockery at the time - but it doesn't appear in this WW1 English translation of an earlier French version from Le Rire magazine anyway.
What happened was a bit more mundane. The Kaiser arrived at the Jaffa Gate, which would have been too small for the carriages of his retinue so the for the visit the Ottomans cut away part of the wall and put a road through; the gap in the wall still exists today.