LLMS_Admin_Post_Table_Instructors::manage_columns( string $column, int $post_id )
Manage content of custom columns
Parameters Parameters
- $column
-
(string) (Required) column key/name
- $post_id
-
(int) (Required) WP Post ID of the coupon for the row
Return Return
(void)
Source Source
File: includes/admin/post-types/post-tables/class.llms.admin.post.table.instructors.php
public function manage_columns( $column, $post_id ) {
$post = llms_get_post( $post_id );
switch ( $column ) {
case 'llms-instructors':
$instructors = $post->get_instructors();
$htmls = array();
foreach ( $instructors as $user ) {
$url = add_query_arg(
array(
'post_type' => $post->get( 'type' ),
'author' => $user['id'],
),
'edit.php'
);
$instructor = llms_get_instructor( $user['id'] );
if ( $instructor ) {
$htmls[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $url ), $instructor->get( 'display_name' ) );
}
}
echo implode( ', ', $htmls );
break;
}
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.13.0 | Introduced. |