Automattic\WooCommerce\Admin\Notes

DataStore::get_notes_where_clauses()publicWC 1.0

Return where clauses for getting notes by status and type. For use in both the count and listing queries. Applies woocommerce_note_where_clauses filter.

Method of the class: DataStore{}

Hooks from the method

Return

String. Where clauses for the query.

Usage

$DataStore = new DataStore();
$DataStore->get_notes_where_clauses( $args, $context );
$args(array)
Array of args to pass.
Default: array()
$context(string)
Optional argument that the woocommerce_note_where_clauses filter can use to determine whether to apply extra conditions. Extensions should define their own contexts and use them to avoid adding to notes where clauses when not needed.
Default: self::WC_ADMIN_NOTE_OPER_GLOBAL

DataStore::get_notes_where_clauses() code WC 7.1.0

public function get_notes_where_clauses( $args = array(), $context = self::WC_ADMIN_NOTE_OPER_GLOBAL ) {
	$where_clauses = $this->args_to_where_clauses( $args );

	/**
	 * Filter the notes WHERE clause before retrieving the data.
	 *
	 * Allows modification of the notes select criterial.
	 *
	 * @param string $where_clauses The generated WHERE clause.
	 * @param array  $args          The original arguments for the request.
	 * @param string $context Optional argument that the woocommerce_note_where_clauses filter can use to determine whether to apply extra conditions. Extensions should define their own contexts and use them to avoid adding to notes where clauses when not needed.
	 */
	return apply_filters( 'woocommerce_note_where_clauses', $where_clauses, $args, $context );
}