Opened 3 years ago

Closed 3 years ago

#14709 closed enhancement (fixed)

WP_User_Query constructor improvements

Reported by: filosofo Owned by: filosofo
Priority: normal Milestone: 3.1
Component: Users Version: 3.0.1
Severity: normal Keywords: has-patch
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 3 years ago.

Download all attachments as: .zip

Change History (4)

  • Type changed from defect (bug) to enhancement

Good idea.

return $this->construct( $query );

Wouldn't the following be just as good?

$this->construct( $query );

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

  • 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.