Automattic\WooCommerce\Internal\ProductFeed\Storage
JsonFileFeed::add_entry
Add an entry to the feed.
Метод класса: JsonFileFeed{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$JsonFileFeed = new JsonFileFeed(); $JsonFileFeed->add_entry( $entry ): void;
- $entry(массив) (обязательный)
- The entry to add.
Код JsonFileFeed::add_entry() JsonFileFeed::add entry WC 11.2.2
public function add_entry( array $entry ): void {
if ( ! is_resource( $this->file_handle ) ) {
return;
}
$json = wp_json_encode( $entry );
if ( false === $json ) {
return;
}
if ( $this->entry_count > 0 ) {
fwrite( $this->file_handle, ',' );
}
fwrite( $this->file_handle, $json );
++$this->entry_count;
}