Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#41167 closed enhancement (fixed)

Remove help text duplication on Site editing screens in network admin

Reported by: johnbillion's profile johnbillion Owned by: flixos90's profile flixos90
Milestone: 4.9 Priority: normal
Severity: normal Version: 3.0
Component: Networks and Sites Keywords: good-first-bug has-patch
Focuses: administration, multisite Cc:

Description

When editing a site in Network Admin, the Help text is duplicated across four files for each of the tabs at the top:

  • site-info.php
  • site-users.php
  • site-themes.php
  • site-settings.php

It should be abstracted into a helper function to avoid quadruplication and to allow the help text to be more easily updated in the future.

Attachments (2)

41167.patch (12.7 KB) - added by atanasangelovdev 8 years ago.
41167.2.patch (12.7 KB) - added by atanasangelovdev 8 years ago.
Refreshed patch without CR

Download all attachments as: .zip

Change History (11)

#1 follow-up: @partyfrikadelle
8 years ago

Hi,

any idea where to put the helper function, so all the files can reference it?

Thanks for your help!
Carsten

#2 in reply to: ↑ 1 @DrewAPicture
8 years ago

Replying to partyfrikadelle:

any idea where to put the helper function, so all the files can reference it?

wp-includes/ms-functions.php would probably work.

#3 @atanasangelovdev
8 years ago

  • Keywords has-patch added; needs-patch removed

Introduced 2 new functions get_site_screen_help_tab_args() and get_site_screen_help_sidebar_content() to solve the duplication.

This ticket was mentioned in Slack in #core-multisite by stevenkword. View the logs.


8 years ago

#5 @stevenkword
8 years ago

  • Keywords needs-refresh added

Thank you for the patch, @atanasangelovdev !

41167.patch applies cleanly as of July 10, 2017, but with warnings. (Stripping trailing CRs from patch; use --binary to disable.) We should refresh this patch with proper formatting. I am also going to add a label for dev-feedback, so we can get some more eyes on this.

@earnjam also has brought up during the weekly Multisite Bug Scrub that we should take a look through Core for other places where we repeat text like this. However, we should probably create those as new tickets to keep this one lean and then related them back to this ticket.

@atanasangelovdev
8 years ago

Refreshed patch without CR

#6 @atanasangelovdev
8 years ago

  • Keywords needs-refresh removed

#7 @flixos90
8 years ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to flixos90
  • Status changed from new to reviewing

Thanks for the patch @atanasangelovdev, it looks good!

I will review in detail a bit later. The new functions should probably go into wp-admin/includes/ms.php though since they're only needed in the admin, but I can change that when reviewing, so you don't need to do another patch just for that. :)

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


8 years ago

#9 @flixos90
8 years ago

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

In 41065:

Multisite: Remove help text duplication on Edit Site screens in the network admin.

Prior to this change, the similar help tab and sidebar for these screens were all duplicated for each respective screen. This changeset introduces two internal admin functions get_site_screen_help_tab_args() and get_site_screen_help_sidebar_content() that make these available in a centralized location.

Props atanasangelovdev.
Fixes #41167.

Note: See TracTickets for help on using tickets.