WP_List_Table Documentation vs Practice
-
Hey,
I’ve a question regarding WP_List_Table
I found that the following notice is listed:
NOTICE: As of WordPress 3.5.1, in core $item is passed an Object, not an array.
However, when I test it out in my code, it seems like $items is still passed as an array in the latest WordPress.
/** * Retrieve the data associated with a specific column. * @param array $item The row * @param string $column_name The index of the column (internal name) */ function column_default($item, $column_name){ var_dump($item); switch ($column_name) { case 'when': return isset($item['when']) ? date('Y-m-d h:i:s' ,trim( $item['when']) ) : '-'; break; default: return isset($item[$column_name]) ? htmlentities($item[$column_name]) : ''; break; } }
I also checked the source and the phpDoc also lists an object instead of an array, but var_dumping results in an array.
Is the documentation correct or is this a bug or did I misunderstand it? If anyone knows, please let me know 🙂
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘WP_List_Table Documentation vs Practice’ is closed to new replies.