ActionScheduler_HybridStore::set_demarkation_id()privateWC 1.0

Store the demarkation id in WP options.

Метод класса: ActionScheduler_HybridStore{}

Хуков нет.


int. The new ID.


// private - только в коде основоного (родительского) класса
$result = $this->set_demarkation_id( $id );
The ID to set as the demarkation point between the two stores Leave null to use the next ID from the WP posts table.
По умолчанию: null

Код ActionScheduler_HybridStore::set_demarkation_id() WC 8.9.0

private function set_demarkation_id( $id = null ) {
	if ( empty( $id ) ) {
		/** @var \wpdb $wpdb */
		global $wpdb;
		$id = (int) $wpdb->get_var( "SELECT MAX(ID) FROM $wpdb->posts" );
		$id ++;
	update_option( self::DEMARKATION_OPTION, $id );

	return $id;