Docblocks

This commit is contained in:
Claudio Sanches 2019-02-01 17:10:31 -02:00
parent e41a81f8b9
commit 93f9ec8ae8
1 changed files with 23 additions and 0 deletions

View File

@ -44,6 +44,11 @@ class WC_Admin_Notes_Data_Store extends WC_Data_Store_WP implements WC_Object_Da
$this->save_actions( $note );
$note->apply_changes();
/**
* Fires when an admin note is created.
*
* @param int $note_id Note ID.
*/
do_action( 'woocommerce_new_note', $note_id );
}
@ -73,6 +78,12 @@ class WC_Admin_Notes_Data_Store extends WC_Data_Store_WP implements WC_Object_Da
$this->read_actions( $note );
$note->read_meta_data();
$note->set_object_read( true );
/**
* Fires when an admin note is loaded.
*
* @param int $note_id Note ID.
*/
do_action( 'woocommerce_admin_note_loaded', $note );
} elseif ( $note_row ) {
$note->set_name( $note_row->name );
@ -89,6 +100,12 @@ class WC_Admin_Notes_Data_Store extends WC_Data_Store_WP implements WC_Object_Da
$this->read_actions( $note );
$note->read_meta_data();
$note->set_object_read( true );
/**
* Fires when an admin note is loaded.
*
* @param int $note_id Note ID.
*/
do_action( 'woocommerce_admin_note_loaded', $note );
} else {
throw new Exception( __( 'Invalid data store for admin note.', 'wc-admin' ) );
@ -138,6 +155,12 @@ class WC_Admin_Notes_Data_Store extends WC_Data_Store_WP implements WC_Object_Da
$note->save_meta_data();
$this->save_actions( $note );
$note->apply_changes();
/**
* Fires when an admin note is updated.
*
* @param int $note_id Note ID.
*/
do_action( 'woocommerce_update_note', $note->get_id() );
}