Astra_Ext_Advanced_Headers_Loader::column_content( array $column, int $post_id )

Adds the custom list table column content.


Description


Parameters

$column

(array) (Required) Name of column.

$post_id

(int) (Required) Post id.


Return

(void)


Source

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

		public function column_content( $column, $post_id ) {

			if ( 'advanced_headers_display_rules' == $column ) {

				$locations = get_post_meta( $post_id, 'ast-advanced-headers-location', true );
				if ( ! empty( $locations ) ) {
					echo '<div class="ast-advanced-headers-location-wrap" style="margin-bottom: 5px;">';
					echo '<strong>Display: </strong>';
					$this->column_display_location_rules( $locations );
					echo '</div>';
				}

				$locations = get_post_meta( $post_id, 'ast-advanced-headers-exclusion', true );
				if ( ! empty( $locations ) ) {
					echo '<div class="ast-advanced-headers-exclusion-wrap" style="margin-bottom: 5px;">';
					echo '<strong>Exclusion: </strong>';
					$this->column_display_location_rules( $locations );
					echo '</div>';
				}

				$users = get_post_meta( $post_id, 'ast-advanced-headers-users', true );
				if ( isset( $users ) && is_array( $users ) ) {
					if ( isset( $users[0] ) && ! empty( $users[0] ) ) {
						$user_label = array();
						foreach ( $users as $user ) {
							$user_label[] = Astra_Target_Rules_Fields::get_user_by_key( $user );
						}
						echo '<div class="ast-advanced-headers-users-wrap">';
						echo '<strong>Users: </strong>';
						echo esc_html( join( ', ', $user_label ) );
						echo '</div>';
					}
				}
			}
		}

Changelog

Changelog
Version Description
1.0 Introduced.


User Contributed Notes

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