InstructorsList::column_display_name( $item )


Source

File: classes/InstructorsList.php

	function column_display_name( $item ) {
		//Build row actions
		$actions = [];

		$status = dozent_instructor_status( $item->ID );

		switch ( $status->status ) {
			case 'pending':
			case 'blocked':

				$actions['approved']
					= sprintf( '<a class="dozent-pill dozent-pill-success" data-action="approve" data-instructor-id="'
					           . $item->ID . '" href="?page=%s&action=%s&instructor=%s"> ' . __( 'Approve', 'dozent' )
					           . ' </a>', $_REQUEST['page'], 'approve', $item->ID );
				break;
			case 'approved':
				$actions['blocked']
					= sprintf( '<a class="dozent-pill dozent-pill-danger" data-action="blocked" data-instructor-id="'
					           . $item->ID
					           . '" href="?page=%s&action=%s&instructor=%s"> <i class="dicon-trash-line"></i> '
					           . __( 'Block', 'dozent' ) . ' </a>', $_REQUEST['page'], 'blocked', $item->ID );
				break;
		}

		//Return the title contents
		return sprintf( '%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
			$item->display_name,
			$item->ID,
			$this->row_actions( $actions )
		);
	}