WP_Plugins_List_Table::_order_callback() WordPress Method

The WP_Plugins_List_Table::_order_callback() method is a private callback method used to order plugin data.

WP_Plugins_List_Table::_order_callback( array $plugin_a, array $plugin_b ) #


Parameters

$plugin_a

(array)(Required)

$plugin_b

(array)(Required)


Top ↑

Return

(int)


Top ↑

Source

File: wp-admin/includes/class-wp-plugins-list-table.php

	public function _order_callback( $plugin_a, $plugin_b ) {
		global $orderby, $order;

		$a = $plugin_a[ $orderby ];
		$b = $plugin_b[ $orderby ];

		if ( $a === $b ) {
			return 0;
		}

		if ( 'DESC' === $order ) {
			return strcasecmp( $b, $a );
		} else {
			return strcasecmp( $a, $b );
		}
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.