Nowadays, every magazine, talk show and fashion brand hires a celebrity wrangler: someone who coaxes stars into appearing on covers or flaunting products on social media.

It’s no accident when a hot actor shows up at a premiere for a movie they’re not even in. A celebrity wrangler got them there to bring attention to the event and the project.

But the Long Island native who invented the job — the original celebrity wrangler — had no idea what she was doing at the time.

“In 1977, fresh out of college, I went on a date with a guy working at ­Enchanted Garden,” Joanne Horowitz told The Post. After checking out the Queens nightclub, she went dancing with her date in Manhattan where they met one of his bosses, Ian Schrager, who started talking about his soon-to-open Studio 54.

Joanne Horowitz

Joanne Horowitz (Getty)

The then-unknown promoter and his business partner, Steve Rubell, were stressed about how to bring media attention to their new Midtown club, on which they had ­already spent a fortune.

A lightbulb went off for Horowitz, then secretary to the head of public relations at Universal Pictures.

“I suddenly found myself telling Ian, ‘I get [the industry publication] Celebrity Bulletin. It tells you where the stars are staying. Give me 200 ­invites and I’ll send them out,’ ” she recalled. “I used Universal stationery to write the letters.”

As a new documentary, “Studio 54,” reveals, that was the make-or-break moment that led to the place becoming New York City’s most legendary nightclub.

Horowitz hand-delivered the ­invites herself.

UNITED STATES - JUNE 14:  HAPPY DAYS -

"Happy Days" star Fonzie (Henry Winkler) sits on his motorcycle. (Getty)

“Henry Winkler came opening night. I invited Cher, and she came. Meanwhile, I knew nobody [personally],” she admitted. “Then Cher wound up on the cover of the New York Post the next day. After that, Ian wanted to make a deal.”

The “deal” was a sliding-scale fee Horowitz negotiated with Rubell and Schrager for any celebrity she got to the club — and in the papers.

“For [Sylvester] Stallone and Michael Jackson, I was paid the most; $250 each if they got the covers of The Post or the Daily News, $150 for inside. For People magazine, I got $250. Same for Time or Newsweek,” Horowitz said. “I got items in Liz Smith[’s column]. I hustled my ass off. Stallone and Michael became personal friends [of mine].

“Although,” she added, “Stallone got photographed with his girlfriend, not his wife, and he wasn’t too pleased.”

For almost the next two years — the length of Studio’s heyday — Horowitz was at the club every single night. She would dance with Jackson, and even wound up dating his brother Jackie for a while. David Bowie became a Studio 54 regular as a result of Horowitz’s wrangling, as did Brooke Shields, Diana Ross, Farrah Fawcett, Ryan O’Neal, Alice Cooper and all the Casablanca agency models, including Cheryl Tiegs.

Farrah Fawcett, circa 1975.

Farrah Fawcett, circa 1975. (Getty)

During the day, she recalled, “Ian and I literally had arguments about what people were worth. I was making a lot of money, all cash off the books.

“People offered me everything to get in: poppers, quaaludes, coke. And I don’t even drink!”

She also tipped off photographers about who would be partying at Studio 54 each night, which only once created a real problem: Notorious paparazzo Ron Galella broke the rules of “no ­photos inside” and got banned for snapping actors Dyan Cannon and ­Armand Assante.

After the club closed, Horowitz’s career really flourished, as film studios and record companies snapped her up to magically deliver stars to their red-carpet events.

The contacts she had made at the club served her well: “I did three parties for Michael Jackson [including] the wrap party for ‘The Wiz,’ ” she ­remembered.

Brooke Shields

Brooke Shields (Reuters)

Now, Horowitz, who is single and an animal activist, is a ­major talent manager with clients ­including Tyrese Gibson and Jack Lemmon’s actress granddaughter Sydney Lemmon (and, until two years ago, Kevin Spacey).

And she’s a legend in Hollywood herself. “One night at a dinner, two men told me they knew all about me and my life would make a great movie: [directors] Jay Roach and Sydney Pollack!” she said. (While that movie never got made, she gets her close-up in this documentary.)

Horowitz admitted there’s one big difference between celebrity wrangling today and when she invented it 41 years ago: “You have to pay the celebrities to show up!”

In 2016, GQ reported that Kardashian baby daddy Scott Disick regularly earned as much as $80,000 a night for a nightclub appearance.

According to TMZ, boxer Floyd Mayweather Jr. was offered some $60,000 to hang out at a pool party for 30 minutes.

Boxer Floyd Mayweather Jr. watches during the second half of an NBA basketball game between the Los Angeles Lakers and the Los Angeles Clippers, Thursday, Oct. 19, 2017, in Los Angeles. The Clippers won 108-92. (AP Photo/Mark J. Terrill)

Floyd Mayweather (AP)

As Horowitz marvels, “When I did it . . . the one who got paid was me.”

This article originally appeared on Page Six.