Automattic\WooCommerce\Admin\Notes
DataStore::delete() public WC 1.0
Deletes a note from the database.
{} Это метод класса: DataStore{}
Хуки из метода
Возвращает
null
. Null. Ничего.
Использование
$DataStore = new DataStore(); $DataStore->delete( $note, $args );
- $note(Note) (обязательный)
- Admin note.
- $args(массив)
- Array of args to pass to the delete method (not used).
Код DataStore::delete() DataStore::delete WC 5.1.0
public function delete( &$note, $args = array() ) {
$note_id = $note->get_id();
if ( $note_id ) {
global $wpdb;
$wpdb->delete( $wpdb->prefix . 'wc_admin_notes', array( 'note_id' => $note_id ) );
$wpdb->delete( $wpdb->prefix . 'wc_admin_note_actions', array( 'note_id' => $note_id ) );
$note->set_id( null );
}
/**
* Fires when an admin note is deleted.
*
* @param int $note_id Note ID.
*/
do_action( 'woocommerce_note_deleted', $note_id );
}