Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2386 closed defect (bug) (fixed)

the_author('idmode'), idmode is deprecated

Reported by: MichaelH Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.0
Component: Template Keywords: bg|has-patch
Focuses: Cc:


Using the_author('idmode') returns just the display_name, no matter the value entered in the 'idmode' parameter.

According to http://codex.wordpress.org/Template_Tags/the_author the 'idmode' parameter allows you to control what gets returned by this function. It looks like it was there in 1.5.2 so here's a patch to put it back.

If this doesn't belong in the function, I'll fix Codex. Thanks.

Attachments (3)

2386.diff (1.1 KB) - added by MichaelH 12 years ago.
adds idmode ability to the_author in template-functions-author.php
2386a.diff (1.1 KB) - added by westi 12 years ago.
Patch rebased against trunk
2386b.diff (1.1 KB) - added by westi 12 years ago.
Use switch not if if if if if if

Download all attachments as: .zip

Change History (18)

12 years ago

adds idmode ability to the_author in template-functions-author.php

#1 @MichaelH
12 years ago

Additional note--I used nickname but somewhere I remember discussion that user_nickname will eventually work.

Function will return display_name if no parameter is passed.

#2 @westi
12 years ago

  • Component changed from Administration to Template
  • Keywords bg|has-patch added
  • Milestone set to 2.1
  • Priority changed from low to normal

For reference this was removed by matt in changeset [2633] while doing all the new user stuff for 2.0.

It was also removed from get_author_name in functions-post.php in the same changeset so will need fixing there as well.

#3 @MichaelH
12 years ago

Not to sure if get_author_name needs changing.

It seems somewhere along the line, the_author was changed from having no parameters to having the idmode and echo parameters.

I've made a note in Codex that currently, only the display_name value gets displayed/returned by this function. Based on the inclusion of this Ticket in subsequent releases, I'll revise Codex accordingly.

Thanks westi!

#4 @MichaelH
12 years ago

Also tested the 2386.diff fix with the_author_posts_link() and the various idmode settings decribed in http://codex.wordpress.org/Template_Tags/the_author_posts_link and it works.

Again I've explained on the Codex page that the idmode isn't working now. And, I'll also revise that Codex page on disposition of this ticket.

12 years ago

Patch rebased against trunk

#5 @ryan
12 years ago

Can we make those ifs if ... else if ... else if ... or a switch to avoid unnecessary comparisons?

12 years ago

Use switch not if if if if if if

#6 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4140]) Resurrect idmode. Props MichaelH and westi. fixes #2386

#7 @matt
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This was a deliberate removal. Please revert 4140 and update the documentation.

#8 @ryan
12 years ago

Deliberately broken. This is a back compat issue that comes up often.

#9 @ryan
12 years ago

idmode is used extensively in the author API. I wish it had never existed, but it does and leaving it broken seems lame. Regardless, I'll roll it back and comment the API.

#10 @ryan
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [4146]) Deprecate idmode. fixes #2386

#11 @matt
12 years ago

It has been gone for close to a year, compat issues have already passed and I'd rather not reintroduce cruft.

#12 @foolswisdom
12 years ago

  • Summary changed from the_author('idmode') only returns display_name to the_author('idmode'), idmode is deprecated

Summary the_author('idmode'), idmode is deprecated was the_author('idmode') only returns display_name

I have updated the Codex.

#13 @ryan
12 years ago

(In [4234]) Deprecate idmode. fixes #2386

#14 @foolswisdom
12 years ago

  • Milestone changed from 2.1 to 2.0.5

#15 @(none)
11 years ago

  • Milestone 2.0.5 deleted

Milestone 2.0.5 deleted

Note: See TracTickets for help on using tickets.