Astra_Ext_Advanced_Hooks_Loader::column_display_location_rules( array $locations )

Get Markup of Location rules for Display rule column.


Description


Parameters

$locations

(array) (Required) Array of locations.


Return

(void)


Source

File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-loader.php

		public function column_display_location_rules( $locations ) {

			$location_label = array();
			$index          = array_search( 'specifics', $locations['rule'] );
			if ( false !== $index && ! empty( $index ) ) {
				unset( $locations['rule'][ $index ] );
			}

			if ( isset( $locations['rule'] ) && is_array( $locations['rule'] ) ) {
				foreach ( $locations['rule'] as $location ) {
					$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
				}
			}
			if ( isset( $locations['specific'] ) && is_array( $locations['specific'] ) ) {
				foreach ( $locations['specific'] as $location ) {
					$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
				}
			}

			echo esc_html( join( ', ', $location_label ) );
		}


User Contributed Notes

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