Astra_Notices::sort_notices( array $notice_1, array $notice_2 )

Sort the notices based on the given priority of the notice.


Description

This function is called from usort()


Parameters

$notice_1

(array) (Required) First notice.

$notice_2

(array) (Required) Second Notice.


Return

(array)


Source

File: inc/lib/astra-notices/class-astra-notices.php

		public function sort_notices( $notice_1, $notice_2 ) {
			if ( ! isset( $notice_1['priority'] ) ) {
				$notice_1['priority'] = 10;
			}
			if ( ! isset( $notice_2['priority'] ) ) {
				$notice_2['priority'] = 10;
			}

			return $notice_1['priority'] - $notice_2['priority'];
		}

Changelog

Changelog
Version Description
1.5.2 Introduced.

User Contributed Notes

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