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


Top ↑

Return Return

(array)


Top ↑

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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.