Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1456 closed defect (bug) (fixed)

wp_notify_moderator includes unnecessary DB query [patch]

Reported by: skippy's profile skippy Owned by: markjaquith's profile markjaquith
Milestone: Priority: low
Severity: normal Version:
Component: Optimization Keywords: bg|commit bg|has-patch
Focuses: Cc:


wp_notify_moderator(), on line 243 of pluggable-functions.php:
$user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE ID='$post->post_author' LIMIT 1");

The $user variable is not used in this function, and is therefore unnecessary.

Attachments (1)

pluggable-functions.php.diff (702 bytes) - added by markjaquith 19 years ago.
patch for 1.6 SVN

Download all attachments as: .zip

Change History (4)

19 years ago

patch for 1.6 SVN

#1 @markjaquith
19 years ago

  • Owner changed from anonymous to matt
  • Summary changed from wp_notify_moderator includes unnecessary DB query to wp_notify_moderator includes unnecessary DB query [patch]

Looks like it was just copied from wp_notify_postauthor() where it is needed. Good catch!

#2 @markjaquith
19 years ago

  • Keywords bg|commit bg|has-patch added
  • Owner changed from matt to markjaquith
  • Status changed from new to assigned

#3 @matt
19 years ago

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

(In [2688]) Unecessary query, fixes #1456

Note: See TracTickets for help on using tickets.