There are various ways to get user_ID in WP. But which one is the fastest ? I’ve compared 3 ways

Without a doubt, global method was fastest. With multiple 100,000 runs, global method took 0.9~ sec, while wp_get_current_user()->ID method took took 1.3~ sec and get_current_user_id() took 1.5~ sec.

Leave a Reply

Your email address will not be published.