WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#34097 closed defect (bug) (fixed)

Fix docs for is_email filter

Reported by: chris@… Owned by: DrewAPicture
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.8
Component: Formatting Keywords: has-patch commit
Focuses: docs Cc:

Description

The docs for the is_email action state that there are four parameters passed when in fact there are only three:

        /**
         * Filter whether an email address is valid.
         *
         * This filter is evaluated under several different contexts, such as 'email_too_short',
         * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
         * 'domain_no_periods', 'sub_hyphen_limits', 'sub_invalid_chars', or no specific context.
         *
         * @since 2.8.0
         *
         * @param bool   $is_email Whether the email address has passed the is_email() checks. Default false.
         * @param string $email    The email address being checked.
         * @param string $message  An explanatory message to the user.
         * @param string $context  Context under which the email was tested.
         */
         return apply_filters( 'is_email', false, $email, 'email_too_short' );

I don't know if someone was planning on adding $message or if they were confusing it with $context but since the latter is described more I kept that one.

Attachments (1)

formatting.diff (610 bytes) - added by chris@… 6 years ago.

Download all attachments as: .zip

Change History (4)

@chris@…
6 years ago

#1 @DrewAPicture
6 years ago

  • Owner set to DrewAPicture
  • Status changed from new to reviewing

#2 @DrewAPicture
6 years ago

  • Component changed from General to Formatting
  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.4
  • Version changed from trunk to 3.8

Hi @chrisvendiadvertisingcom, welcome to Trac, and thanks for the patch. Good catch!

#3 @DrewAPicture
6 years ago

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

In 34770:

Docs: Remove documentation for a phantom parameter not actually passed to the is_email filter.

The documentation error was introduced in [26485].

Props chrisvendiadvertisingcom.
Fixes #34097.

Note: See TracTickets for help on using tickets.