Upload::js_args()

Description #

Return arguments for used by JS.

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: lib/form/class-upload.php

	public function js_args() {
		$args        = $this->get( 'upload_options' );
		$allowed_ext = '.' . str_replace( '|', ',.', implode( ',.', array_keys( $args['allowed_mimes'] ) ) );

		unset( $args['allowed_mimes'] );
		$args['field_name'] = $this->original_name;
		$args['form_name']  = $this->form_name;

		return wp_json_encode( $args );
	}

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