Automattic\WooCommerce\RestApi\Utilities
ImageAttachment::update_alt_text
Update attachment alt text.
Метод класса: ImageAttachment{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ImageAttachment = new ImageAttachment(); $ImageAttachment->update_alt_text( $text );
- $text(строка) (обязательный)
- Text to set.
Код ImageAttachment::update_alt_text() ImageAttachment::update alt text WC 10.3.4
public function update_alt_text( $text ) {
if ( ! $this->id ) {
return;
}
update_post_meta( $this->id, '_wp_attachment_image_alt', wc_clean( $text ) );
}