Wishlist::add_wishlist_meta_item( $items,  $course_id )


Source

File: classes/Wishlist.php

	public function add_wishlist_meta_item( $items, $course_id ) {

		$btn_text = sprintf( __( ' %s Add to Wishlist', 'dozent' ), '<i class="dicon-heart-o"></i>' );

		if ( is_user_logged_in() ) {
			$user_id = get_current_user_id();

			$in_wishlist = $this->has_in_wishlist( $course_id, $user_id );
			if ( $in_wishlist ) {
				$btn_text = sprintf( __( ' %s Remove from Wishlist', 'dozent' ), '<i class="dicon-heart"></i>' );
			}
		}

		$output
			= "<a href='javascript:;' class='dozent-wishlist-toggle-btn' data-course-id='{$course_id}' > {$btn_text} </a>";

		$items['wishlist'] = $output;

		return $items;
	}