WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#14709 closed enhancement (fixed)

WP_User_Query constructor improvements

Reported by: filosofo Owned by: filosofo
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0.1
Component: Users Keywords: has-patch
Focuses: Cc:

Description

  • We should be able to extend the class and invoke the parent constructor agnostic of the particular class name of the parent, e.g. return parent::__construct()
  • We should be able to instantiate the class without querying immediately (currently the constructor has a mandatory query argument).

Attachments (1)

wp_user_query_constructor.diff (1.3 KB) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 scribu4 years ago

  • Type changed from defect (bug) to enhancement

Good idea.

return $this->construct( $query );

Wouldn't the following be just as good?

$this->construct( $query );

comment:2 filosofo4 years ago

You're right; that's just force of habit. Returning a constructor doesn't do anything.

comment:3 scribu4 years ago

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

(In [15543]) WP_User_Query constructor improvements. Props filosofo. Fixes #14709

Note: See TracTickets for help on using tickets.