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".
Return Return
(string) A comma-separated list of HTML anchor tags.
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 );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |