WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#35911 closed defect (bug) (fixed)

Simplify the credits page with an if/else statment

Reported by: ramiy Owned by: ocean90
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Administration Keywords: 2nd-opinion dev-feedback
Focuses: administration Cc:

Description

in the current page, if we don't receive any data from dotorg API, we exit;.

This can be replaced with a simple if/else statement.

A simple message if no result returned, or a list of contributors if we did get the results from the API.

Attachments (2)

35911.patch (909 bytes) - added by ramiy 5 years ago.
35911.2.patch (949 bytes) - added by ramiy 5 years ago.
Sorry, this is the latest patch

Download all attachments as: .zip

Change History (7)

@ramiy
5 years ago

@ramiy
5 years ago

Sorry, this is the latest patch

#1 @ramiy
5 years ago

This patch fixes the unclosed <div> when no result receive from the API.

Also, we don't need to call wp-admin/admin-footer.php twice, and we don't need to use the 'exit;' function.

Last edited 5 years ago by ramiy (previous) (diff)

#2 @ocean90
4 years ago

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

In 37434:

Credits: Add a missing closing tag.

Props ramiy for initial patch.
Fixes #35911.

#3 @ocean90
4 years ago

  • Milestone changed from Awaiting Review to 4.6

#4 @ramiy
4 years ago

@ocean90 please review the patch again.

Currently we call the admin-footer.php twice, and use the exit function. It's redundant.


The current code:

if ( ! $credits ) {
	...
	...
	include( ABSPATH . 'wp-admin/admin-footer.php' );
	exit;
}

...
...

include( ABSPATH . 'wp-admin/admin-footer.php' );

The new code:

if ( ! $credits ) {
	...
	...
} else {
	...
	...
}

include( ABSPATH . 'wp-admin/admin-footer.php' );

#5 @ramiy
4 years ago

  • Keywords 2nd-opinion dev-feedback added
Note: See TracTickets for help on using tickets.