Automattic\WooCommerce\RestApi\Utilities
ImageAttachment::update_name
Update attachment name.
Method of the class: ImageAttachment{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ImageAttachment = new ImageAttachment(); $ImageAttachment->update_name( $text );
- $text(string) (required)
- Text to set.
ImageAttachment::update_name() ImageAttachment::update name code WC 10.3.6
public function update_name( $text ) {
if ( ! $this->id ) {
return;
}
wp_update_post(
array(
'ID' => $this->id,
'post_title' => $text,
)
);
}