LLMS_Table_Achievements::get_data( string $key, mixed $data )
Retrieve data for the columns
Description Description
Parameters Parameters
- $key
-
(string) (Required) the column id / key
- $data
-
(mixed) (Required) object of achievement data
Return Return
(mixed)
Source Source
File: includes/admin/reporting/tables/llms.table.achievements.php
public function get_data( $key, $data ) { switch ( $key ) { case 'actions': $value = $this->get_actions_html( $data->achievement_id ); break; case 'related': if ( $data->post_id && 'llms_achievement' !== get_post_type( $data->post_id ) ) { if ( is_numeric( $data->post_id ) ) { $value = $this->get_post_link( $data->post_id, get_the_title( $data->post_id ) ); } else { $value = $data->post_id; } } else { $value = '–'; } break; case 'earned': $value = date_i18n( 'F j, Y', strtotime( $data->earned_date ) ); break; case 'id': $value = $data->achievement_id; break; case 'image': $value = wp_get_attachment_image( get_post_meta( $data->achievement_id, '_llms_achievement_image', true ), array( 64, 64 ) ); break; case 'template_id': // prior to 3.2 this data wasn't recorded $template = get_post_meta( $data->achievement_id, '_llms_achievement_template', true ); if ( $template ) { $value = $this->get_post_link( $template ); } else { $value = '–'; } break; case 'name': $value = get_post_meta( $data->achievement_id, '_llms_achievement_title', true ); break; default: $value = $key; }// End switch(). return $this->filter_get_data( $value, $key, $data ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.2.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: