LLMS_Admin_Media_Protection_Attachment_Settings::attachment_fields_to_save( array $post, array $attachment )
Save the media protection settings
Parameters Parameters
- $post
-
(array) (Required) Array of post data
- $attachment
-
(array) (Required) Array of attachment data
Return Return
(array)
Source Source
File: includes/admin/class-llms-admin-media-protection-attachment-settings.php
public function attachment_fields_to_save( $post, $attachment ) {
if ( ! empty( $attachment['llms_media_protection_post'] ) ) {
if ( $this->move_attachment_to_protected_dir( $post['ID'] ) ) {
update_post_meta( $post['ID'], '_llms_media_protection_product_id', absint( $attachment['llms_media_protection_post'] ) );
}
}
return $post;
}
Expand full source code Collapse full source code View on GitHub