AP_Form_Hooks::image_upload_form()

Description #

Image upload form.

This form is used for uploading images in AnsPress.

Changelog #

VersionDescription
4.1.8Introduced.

Source #

File: includes/class-form-hooks.php

	public static function image_upload_form() {
		return array(
			'submit_label' => __( 'Upload & insert', 'anspress-question-answer' ),
			'fields'       => array(
				'image' => array(
					'label'          => __( 'Image', 'anspress-question-answer' ),
					'desc'           => __( 'Select image(s) to upload. Only .jpg, .png and .gif files allowed.', 'anspress-question-answer' ),
					'type'           => 'upload',
					'save'           => array( __CLASS__, 'image_upload_save' ),
					'upload_options' => array(
						'multiple'      => false,
						'max_files'     => 1,
						'allowed_mimes' => array(
							'jpg|jpeg' => 'image/jpeg',
							'gif'      => 'image/gif',
							'png'      => 'image/png',
						),
					),
					'validate'       => 'required',
				),
			),
		);
	}

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