Changeset 33985 for trunk/src/wp-admin/includes/screen.php
- Timestamp:
- 09/10/2015 01:26:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/screen.php
r33689 r33985 719 719 * 720 720 * @since 3.4.0 721 * @since 4.4.0 Help tabs are ordered by their priority. 721 722 * 722 723 * @return array Help tabs with arguments. 723 724 */ 724 725 public function get_help_tabs() { 725 return $this->_help_tabs; 726 $help_tabs = $this->_help_tabs; 727 uasort( $help_tabs, array( $this, '_sort_help_tabs' ) ); 728 return $help_tabs; 729 } 730 731 /** 732 * Compares the difference between the help tabs priorities. 733 * 734 * Used for help tabs sorting. 735 * 736 * @since 4.4.0 737 * 738 * @param int $tab_a The priority argument for the first tab. 739 * @param int $tab_b The priority argument for the second tab. 740 * @return int The difference between the priority arguments. 741 */ 742 protected function _sort_help_tabs( $tab_a, $tab_b ) { 743 return $tab_a['priority'] - $tab_b['priority']; 726 744 } 727 745 … … 745 763 * 746 764 * @since 3.3.0 747 * 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 * 765 * @since 4.4.0 The `$priority` argument was added. 766 * 767 * @param array $args { 768 * Array of arguments used to display the help tab. 769 * 770 * @type string $title Title for the tab. Default false. 771 * @type string $id Tab ID. Must be HTML-safe. Default false. 772 * @type string $content Optional. Help tab content in plain text or HTML. Default empty string. 773 * @type string $callback Optional. A callback to generate the tab content. Default false. 774 * @type int $priority Optional. The priority of the tab, used for ordering. Default 10. 775 * } 754 776 */ 755 777 public function add_help_tab( $args ) { … … 759 781 'content' => '', 760 782 'callback' => false, 783 'priority' => 10, 761 784 ); 762 785 $args = wp_parse_args( $args, $defaults );
Note: See TracChangeset
for help on using the changeset viewer.