Automattic\WooCommerce\RestApi\Utilities

ImageAttachment::update_name()publicWC 1.0

Update attachment name.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$ImageAttachment = new ImageAttachment();
$ImageAttachment->update_name( $text );
$text(строка) (обязательный)
Text to set.

Код ImageAttachment::update_name() WC 8.7.0

public function update_name( $text ) {
	if ( ! $this->id ) {
		return;
	}
	wp_update_post(
		array(
			'ID'         => $this->id,
			'post_title' => $text,
		)
	);
}