* Notes panel: only request fields needed for render.

* Avoid retrieving post meta for WC_Admin_Note objects.

It's an ID collision anyhow.
This commit is contained in:
Jeff Stieler 2020-04-22 10:05:11 -06:00 committed by GitHub
parent 0e94da6160
commit 267c95e8d5
2 changed files with 24 additions and 0 deletions

View File

@ -126,6 +126,18 @@ export default compose(
orderby: 'date',
order: 'desc',
status: 'unactioned',
_fields: [
'id',
'name',
'title',
'content',
'type',
'icon',
'status',
'actions',
'date_created',
'date_created_gmt',
],
};
const notes = getNotes( inboxQuery );

View File

@ -151,6 +151,18 @@ class WC_Admin_Note extends \WC_Data {
|
*/
/**
* Returns all data for this object.
*
* Override \WC_Data::get_data() to avoid errantly including meta data
* from ID collisions with the posts table.
*
* @return array
*/
public function get_data() {
return array_merge( array( 'id' => $this->get_id() ), $this->data );
}
/**
* Get note name.
*