Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#8274 closed defect (bug) (invalid)

"Right Now" dashboard module does not check if there are pages before using the number

Reported by: nightgunner5's profile nightgunner5 Owned by:
Milestone: Priority: low
Severity: trivial Version: 2.7
Component: UI Keywords:
Focuses: Cc:

Description

The "Right Now" dashboard module does not check if there are pages before using the number:

	// Pages
	$num = number_format_i18n( $num_pages->publish );
	if ( current_user_can( 'edit_pages' ) )
		$num = "<a href='edit-pages.php'>$num</a>";
	echo '<td class="first b b_pages">'.$num.'</td>';
	echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>';

Attachments (1)

dashboard-no-pages.diff (790 bytes) - added by nightgunner5 17 years ago.
Patch for this ticket

Download all attachments as: .zip

Change History (3)

@nightgunner5
17 years ago

Patch for this ticket

#1 @ryan
17 years ago

  • Component changed from Administration to UI
  • Owner anonymous deleted

#2 @jacobsantos
17 years ago

  • Keywords has-patch removed
  • Milestone 2.7 deleted
  • Resolution set to invalid
  • Status changed from new to closed

wp_count_posts() will already return an integer (but it should be cast to an integer).

Patch should fix wp_count_posts() instead, if there was a problem.

Note: See TracTickets for help on using tickets.