Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WP_Plugin_Install_List_Table::order_callback() WordPress Method

The WP_Plugin_Install_List_Table::order_callback() method is used to order the plugins by their name, author, or number of active installs.

WP_Plugin_Install_List_Table::order_callback( object $plugin_a, object $plugin_b ) #


Parameters

$plugin_a

(object)(Required)

$plugin_b

(object)(Required)


Top ↑

Return

(int)


Top ↑

Source

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

	private function order_callback( $plugin_a, $plugin_b ) {
		$orderby = $this->orderby;
		if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
			return 0;
		}

		$a = $plugin_a->$orderby;
		$b = $plugin_b->$orderby;

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

		if ( 'DESC' === $this->order ) {
			return ( $a < $b ) ? 1 : -1;
		} else {
			return ( $a < $b ) ? -1 : 1;
		}
	}

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.