Make WordPress Core

Opened 10 years ago

Closed 9 years ago

Last modified 9 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 10 years ago.
adds idmode ability to the_author in template-functions-author.php
2386a.diff (1.1 KB) - added by westi 9 years ago.
Patch rebased against trunk
2386b.diff (1.1 KB) - added by westi 9 years ago.
Use switch not if if if if if if

Download all attachments as: .zip

Change History (18)

@MichaelH10 years ago

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

comment:1 @MichaelH10 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.

comment:2 @westi10 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.

comment:3 @MichaelH10 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!

comment:4 @MichaelH10 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.

@westi9 years ago

Patch rebased against trunk

comment:5 @ryan9 years ago

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

@westi9 years ago

Use switch not if if if if if if

comment:6 @ryan9 years ago

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

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

comment:7 @matt9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:8 @ryan9 years ago

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

comment:9 @ryan9 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.

comment:10 @ryan9 years ago

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

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

comment:11 @matt9 years ago

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

comment:12 @foolswisdom9 years ago

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

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

I have updated the Codex.

comment:13 @ryan9 years ago

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

comment:14 @foolswisdom9 years ago

  • Milestone changed from 2.1 to 2.0.5

comment:15 @anonymous9 years ago

  • Milestone 2.0.5 deleted

Milestone 2.0.5 deleted

Note: See TracTickets for help on using tickets.