function initialize()

in web/wp-content/plugins/acf-extended/includes/modules/form/module-form.php [14:138]


    function initialize(){
        
        $this->name         = 'form';
        $this->plural       = 'forms';
        $this->setting      = 'modules/forms';
        
        $this->post_type    = 'acfe-form';
        $this->args         = array(
            'label'             => __('Forms', 'acfe'),
            'show_in_menu'      => 'edit.php?post_type=acf-field-group',
            'hierarchical'      => true,
            'menu_icon'         => 'dashicons-layout',
            'labels'            => array(
                'name'          => __('Forms', 'acfe'),
                'singular_name' => __('Form', 'acfe'),
                'menu_name'     => __('Forms', 'acfe'),
                'edit_item'     => __('Edit Form', 'acfe'),
                'add_new'       => __('New Form', 'acfe'),
                'add_new_item'  => __('New Form', 'acfe'),
                'enter_title'   => __('Form Title', 'acfe'),
            ),
        );
        
        $this->messages     = array(
            'export_title'              => __('Export Forms', 'acfe'),
            'export_description'        => __('Export Forms', 'acfe'),
            'export_select'             => __('Select Forms', 'acfe'),
            'export_not_found'          => __('No form available.', 'acfe'),
            'export_not_selected'       => __('No forms selected', 'acfe'),
            'export_success_single'     => __('1 form exported', 'acfe'),
            'export_success_multiple'   => __('%s forms exported', 'acfe'),
            'export_instructions'       => __('It is recommended to include this code within the <code>acfe/init</code> hook.', 'acfe'),
            'import_title'              => __('Import Forms', 'acfe'),
            'import_description'        => __('Import Forms', 'acfe'),
            'import_success_single'     => __('1 form imported', 'acfe'),
            'import_success_multiple'   => __('%s forms imported', 'acfe'),
        );
    
        $this->export_files = array(
            'single'    => 'form',
            'multiple'  => 'forms',
        );
    
        $this->validate = array('name');
    
        $this->columns  = array(
            'acfe-name'         => __('Name', 'acfe'),
            'acfe-field-groups' => __('Field Groups', 'acfe'),
            'acfe-actions'      => __('Actions', 'acfe'),
            'acfe-shortcode'    => __('Shortcode', 'acfe'),
        );
    
        $this->item     = array(
            'name'          => '',
            'title'         => '',
            'active'        => true,
            'field_groups'  => array(),
            'settings'      => array(
                'location' => false,
                'honeypot' => true,
                'kses'     => true,
                'uploader' => 'default',
            ),
            'attributes'    => array(
                'form' => array(
                    'element' => 'form',
                    'class'   => '',
                    'id'      => '',
                ),
                'fields' => array(
                    'element'       => 'div',
                    'wrapper_class' => '',
                    'class'         => '',
                    'label'         => 'top',
                    'instruction'   => 'label',
                ),
                'submit' => array(
                    'value'   => __('Submit', 'acfe'),
                    'button'  => '<input type="submit" class="acf-button button button-primary button-large" value="%s" />',
                    'spinner' => '<span class="acf-spinner"></span>',
                )
            ),
            'validation'    => array(
                'hide_error'        => false,
                'hide_revalidation' => false,
                'hide_unload'       => false,
                'errors_position'   => 'above',
                'errors_class'      => '',
                'messages'          => array(
                    'failure' => __('Validation failed', 'acf'),
                    'success' => __('Validation successful', 'acf'),
                    'error'   => __('1 field requires attention', 'acf'),
                    'errors'  => __('%d fields require attention', 'acf'),
                ),
            ),
            'success'       => array(
                'hide_form' => false,
                'scroll'    => false,
                'message'   => __('Form updated', 'acfe'),
                'wrapper'   => '<div id="message" class="updated">%s</div>',
            ),
            'actions'       => array(),
            'render'        => '',
        );
    
        $this->alias    = array(
            'title' => 'label',
        );
        
        $this->l10n = array(
            'title',
            'attributes.submit.value',
            'validation.messages.failure',
            'validation.messages.success',
            'validation.messages.error',
            'validation.messages.errors',
            'success.message'
        );
        
        $this->add_action('admin_menu', array($this, 'admin_menu'), 999);
        $this->add_action('register_post_type_args', array($this, 'register_post_type_args'), 10, 2);
        
        $this->add_module_action('acfe/module/prepare_item_for_export', array($this, 'prepare_for_export'));
        
    }