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

996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
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