WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 15 months ago

#19828 closed enhancement (fixed)

allowing to insert help tab in specific position

Reported by: tfnab Owned by: swissspidy
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.3.1
Component: Administration Keywords: has-patch good-first-bug commit
Focuses: Cc:

Description

this enhancement of add_help_tab() would allow plugin developers to insert help tabs on existing screens at an arbitrary position, e.g. place it on the "Writing Settings" screen's help tab between the "Overview" and "Press This" tabs

the patch attached includes the bugfix from #19827, but this enhancement can be rewritten to work independently

Attachments (5)

core-ticket19828.diff (2.5 KB) - added by tfnab 5 years ago.
wp-admin-includes-screen.diff (2.0 KB) - added by dustyf 2 years ago.
Patch dds priority argument for help tabs and method to sort by argument
19828.diff (2.1 KB) - added by OriginalEXE 15 months ago.
Refreshed patch (4.3) for 4.4
19828.2.diff (4.4 KB) - added by swissspidy 15 months ago.
19828.3.diff (4.6 KB) - added by swissspidy 15 months ago.
This patch addresses the issues mentioned by @DrewAPicture

Download all attachments as: .zip

Change History (23)

#1 @nacin
5 years ago

It would probably be best to implement a priority system.

#2 @chriscct7
2 years ago

  • Keywords needs-refresh added; has-patch removed

#3 @helen
2 years ago

  • Keywords good-first-bug added

Seems like a fairly standalone patch exploration.

#4 @helen
2 years ago

  • Keywords needs-refresh removed

This ticket was mentioned in Slack in #core by mattshaw. View the logs.


2 years ago

@dustyf
2 years ago

Patch dds priority argument for help tabs and method to sort by argument

#6 @dustyf
2 years ago

Patch submitted adding a priority argument for the help tabs and a method to sort the tabs before display. By default, tabs will have a priority of 10 and priorities can be passed in with the default $args when adding new tabs.

This ticket was mentioned in Slack in #core by dustyf. View the logs.


2 years ago

#8 @dustyf
2 years ago

  • Keywords good-first-bug removed

This ticket was mentioned in Slack in #core by dustyf. View the logs.


2 years ago

#10 @chriscct7
2 years ago

  • Keywords has-patch added

#11 @helen
2 years ago

  • Keywords good-first-bug added
  • Owner set to dustyf
  • Status changed from new to assigned

#12 @swissspidy
18 months ago

  • Keywords needs-refresh added

@OriginalEXE
15 months ago

Refreshed patch (4.3) for 4.4

#13 @OriginalEXE
15 months ago

  • Keywords needs-refresh removed

Hi, submitted the refreshed patch based on @dustyf patch provided 10 months ago.

#14 @swissspidy
15 months ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to 4.4
  • Owner changed from dustyf to swissspidy

Almost perfect. Will add some unit tests / adjust the existing one.

@swissspidy
15 months ago

#15 @swissspidy
15 months ago

  • Keywords commit added; needs-unit-tests removed

What 19828.2.diff does:

  • Makes the _sort_help_tabs callback method protected, to match other sort callbacks in core.
  • Uses uasort to preserve the array keys
  • Adjusts the test_get_help_tabs unit test
  • Adds a new test_help_tabs_priority test.

#16 @DrewAPicture
15 months ago

  • Keywords commit removed

A few docs notes on 19828.2.diff:

  • We'll need a changelog entry for get_help_tabs() for the introduction of priorities
  • Two newlines should be added before the second sentence in the summary for _sort_help_tabs() (it's the description)
  • No new line between the @param block and @return in _sort_help_tabs()
  • Need a changelog entry for the new argument in add_help_tab(). I suggest:
    * @since 4.4.0 The `$priority` argument was added.
    

@swissspidy
15 months ago

This patch addresses the issues mentioned by @DrewAPicture

#17 @DrewAPicture
15 months ago

  • Keywords commit added

19828.3.diff looks good. Thanks @swissspidy :-)

#18 @wonderboymusic
15 months ago

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

In 33985:

Implement a priority system for Help Tabs to add them at specific positions.

Adds unit tests.

Props swissspidy.
Fixes #19828.

Note: See TracTickets for help on using tickets.