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


Parameters Parameters

$plugin_a

(array) (Required)

$plugin_b

(array) (Required)


Top ↑

Return Return

(int)


Top ↑

Source 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 );
		}
	}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.