Ticket #19828: 19828.diff
File 19828.diff, 2.1 KB (added by , 4 years ago) |
---|
-
wp-admin/includes/screen.php
719 719 * 720 720 * @since 3.4.0 721 721 * 722 * @return array Help tabs with arguments .722 * @return array Help tabs with arguments sorted by their priority. 723 723 */ 724 724 public function get_help_tabs() { 725 return $this->_help_tabs; 725 $help_tabs = $this->_help_tabs; 726 usort( $help_tabs, array( $this, 'sort_help_tabs' ) ); 727 return $help_tabs; 726 728 } 727 729 730 /** 731 * Compares the difference between the help tabs priorities. Used for help tabs sorting. 732 * 733 * @since 4.4.0 734 * 735 * $param int $tab_a The priority argument for the first tab. 736 * $param int $tab_b The priority argument for the second tab. 737 * @return int The difference between the priority arguments. 738 */ 739 function sort_help_tabs( $tab_a, $tab_b ) { 740 return $tab_a['priority'] - $tab_b['priority']; 741 } 742 728 743 /** 729 744 * Gets the arguments for a help tab. 730 745 * … … 745 760 * 746 761 * @since 3.3.0 747 762 * 748 * @param array $args 749 * - string - title - Title for the tab. 750 * - string - id - Tab ID. Must be HTML-safe. 751 * - string - content - Help tab content in plain text or HTML. Optional. 752 * - callback - callback - A callback to generate the tab content. Optional. 753 * 763 * @param array $args { 764 * Array of arguments used to display the help tab. 765 * 766 * @type string $title Title for the tab. Default false. 767 * @type string $id Tab ID. Must be HTML-safe. Default false. 768 * @type string $content Optional. Help tab content in plain text or HTML. Default empty string. 769 * @type string $callback Optional. A callback to generate the tab content. Default false. 770 * @type int $priority Optional. The priority of the tab, used for ordering. Default 10. 771 * } 754 772 */ 755 773 public function add_help_tab( $args ) { 756 774 $defaults = array( … … 758 776 'id' => false, 759 777 'content' => '', 760 778 'callback' => false, 779 'priority' => 10, 761 780 ); 762 781 $args = wp_parse_args( $args, $defaults ); 763 782