Automattic\WooCommerce\RestApi\Utilities

ImageAttachment::update_name()publicWC 1.0

Update attachment name.

Method of the class: ImageAttachment{}

No Hooks.

Return

null. Nothing (null).

Usage

$ImageAttachment = new ImageAttachment();
$ImageAttachment->update_name( $text );
$text(string) (required)
Text to set.

ImageAttachment::update_name() code WC 8.6.1

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