Making WordPress.org

Opened 7 years ago

Closed 7 years ago

#2707 closed defect (bug) (fixed)

Forums: Incorrect docs in User Badges plugin

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Support Forums Keywords: has-patch commit
Cc:

Description (last modified by SergeyBiryukov)

The @return entry for get_author_badge() says:

Associative array with keys 'type', 'slug', and 'user_nicename' if author merits a badge, else null.

Same for get_moderator_badge():

Associative array with keys 'type', 'slug', and 'user_login' if author merits a badge, else false.

However, the actual keys returned in both cases are type, label, and help. Additionally, get_author_badge() return false on error, not null.

Appears to be a copy/paste error in [4269].

Attachments (1)

2707.patch (1.5 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (3)

@SergeyBiryukov
7 years ago

#1 @SergeyBiryukov
7 years ago

  • Description modified (diff)

#2 @coffee2code
7 years ago

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

In 5303:

Support Forums, User Badges: Fix @return docs for get_author_badge() and get_moderator_badge().

Props SergeyBiryukov.
Fixes #2707.

Note: See TracTickets for help on using tickets.