LLMS_Admin_Post_Table_Engagements::manage_columns( string $column, int $post_id )

Manage content of custom coupon columns


Parameters Parameters

$column

(string) (Required) column key/name

$post_id

(int) (Required) WP Post ID of the coupon for the row


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/post-tables/class.llms.admin.post.table.engagements.php

	public function manage_columns( $column, $post_id ) {

		switch ( $column ) {

			case 'trigger':
				$triggers = llms_get_engagement_triggers();

				$trigger = get_post_meta( $post_id, '_llms_trigger_type', true );

				echo isset( $triggers[ $trigger ] ) ? $triggers[ $trigger ] : $trigger;

				$tid = get_post_meta( $post_id, '_llms_engagement_trigger_post', true );
				if ( $tid ) {

					echo '<br>';

					if ( 'course_track_completed' === $trigger ) {
						$term  = get_term( $tid, 'course_track' );
						$title = $term->name;
						$link  = get_edit_term_link( $tid, 'course_track', 'course' );
					} else {
						$title = get_the_title( $tid );
						$link  = get_edit_post_link( $tid );
					}

					printf( '<a href="%s">%s (ID# %d)</a>', $link, $title, $tid );

				}

				break;

			case 'type':
				$types = llms_get_engagement_types();

				$type = get_post_meta( $post_id, '_llms_engagement_type', true );

				echo isset( $types[ $type ] ) ? $types[ $type ] : $type;

				$eid = get_post_meta( $post_id, '_llms_engagement', true );
				if ( $eid ) {

					echo '<br>';
					printf( '<a href="%s">%s (ID# %d)</a>', get_edit_post_link( $eid ), get_the_title( $eid ), $eid );

				}

				break;

			case 'delay':
				$delay = get_post_meta( $post_id, '_llms_engagement_delay', true );

				if ( $delay ) {

					printf( __( '%d days', 'lifterlms' ), $delay );

				} else {

					echo '&ndash;';

				}

				break;

		}

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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