WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Customer_Download_Log_Data_Store::create() WC 1.0

Create download log entry.

Это метод класса: WC_Customer_Download_Log_Data_Store

Возвращает

Null. Ничего.

Использование

$WC_Customer_Download_Log_Data_Store = new WC_Customer_Download_Log_Data_Store();
$var = $WC_Customer_Download_Log_Data_Store->create( $download_log );
$download_log(WC_Customer_Download_Log) (обязательный)
Customer download log object.

Код WC Customer Download Log Data Store::create: woocommerce/includes/data-stores/class-wc-customer-download-log-data-store.php WC 3.6.5

<?php
public function create( WC_Customer_Download_Log &$download_log ) {
	global $wpdb;

	// Always set a timestamp.
	if ( is_null( $download_log->get_timestamp( 'edit' ) ) ) {
		$download_log->set_timestamp( current_time( 'timestamp', true ) );
	}

	$data = array(
		'timestamp'       => date( 'Y-m-d H:i:s', $download_log->get_timestamp( 'edit' )->getTimestamp() ),
		'permission_id'   => $download_log->get_permission_id( 'edit' ),
		'user_id'         => $download_log->get_user_id( 'edit' ),
		'user_ip_address' => $download_log->get_user_ip_address( 'edit' ),
	);

	$format = array(
		'%s',
		'%s',
		'%s',
		'%s',
	);

	$result = $wpdb->insert(
		$wpdb->prefix . self::get_table_name(),
		apply_filters( 'woocommerce_downloadable_product_download_log_insert_data', $data ),
		apply_filters( 'woocommerce_downloadable_product_download_log_insert_format', $format, $data )
	);

	do_action( 'woocommerce_downloadable_product_download_log_insert', $data );

	if ( $result ) {
		$download_log->set_id( $wpdb->insert_id );
		$download_log->apply_changes();
	} else {
		wp_die( esc_html__( 'Unable to insert download log entry in database.', 'woocommerce' ) );
	}
}