Upload::after_save( array $args = array() )

Description #

Set post parent of uploaded files.

Parameters #

  • $args
    array (Optional) Array of arguments. Default value: array()

Source #

File: lib/form/class-upload.php

	public function after_save( $args = array() ) {
		parent::after_save();

		if ( empty( $args ) || empty( $args['post_id'] ) ) {
			return;
		}

		if ( ! empty( $this->uploaded_files ) ) {
			foreach ( $this->uploaded_files as $id ) {
				ap_set_media_post_parent( $id, $args['post_id'] );
			}
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment