LLMS_Admin_Import::get_generated_content_list( int[] $ids, string $type )

Convert an array of generated content IDs to a list of anchor tags to edit the generated content


Parameters Parameters

$ids

(int[]) (Required) Array of object IDs. Either WP_Post IDs or WP_User IDs.

$type

(string) (Required) Object's type. Either "post" or "user".


Top ↑

Return Return

(string) A comma-separated list of HTML anchor tags.


Top ↑

Source Source

File: includes/admin/class.llms.admin.import.php

	protected function get_generated_content_list( $ids, $type ) {

		$list = array();
		foreach ( $ids as $id ) {

			if ( 'post' === $type ) {
				$link = get_edit_post_link( $id );
				$text = get_the_title( $id );
			} elseif ( 'user' === $type ) {
				$link = get_edit_user_link( $id );
				$text = get_user_by( 'ID', $id )->display_name;
			}

			$list[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $link ), $text );

		}

		return implode( ', ', $list );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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