function __construct()
 {
     global $user_ID, $rcl_options;
     $user_can = $rcl_options['user_public_access_recall'];
     if ($user_can && !$user_ID) {
         return false;
     }
     if (isset($_FILES)) {
         require_once ABSPATH . "wp-admin" . '/includes/image.php';
         require_once ABSPATH . "wp-admin" . '/includes/file.php';
         require_once ABSPATH . "wp-admin" . '/includes/media.php';
     }
     if ($_POST['post-rcl']) {
         $post_id = intval($_POST['post-rcl']);
         $this->post_id = $post_id;
         $pst = get_post($this->post_id);
         $this->post_type = $pst->post_type;
         if ($this->post_type == 'post-group') {
             if (!rcl_can_user_edit_post_group($post_id)) {
                 return false;
             }
         } else {
             if (!current_user_can('edit_post', $post_id)) {
                 return false;
             }
             $user_info = get_userdata($user_ID);
             if ($pst->post_author != $user_ID) {
                 $author_info = get_userdata($pst->post_author);
                 if ($user_info->user_level < $author_info->user_level) {
                     return false;
                 }
             }
             if ($user_info->user_level < 10 && rcl_is_limit_editing($post->post_date)) {
                 return false;
             }
         }
         $this->update = true;
     } else {
         if (!session_id()) {
             session_start();
         }
         unset($_SESSION['new-' . $this->post_type]);
         //session_destroy();
     }
     if ($_POST['posttype']) {
         $post_type = sanitize_text_field(base64_decode($_POST['posttype']));
         if (!get_post_types(array('name' => $post_type))) {
             wp_die(__('Error publishing!', 'wp-recall'));
         }
         $this->post_type = $post_type;
         $this->update = false;
     }
     do_action('init_update_post_rcl', $this);
     add_filter('pre_update_postdata_rcl', array(&$this, 'add_data_post'), 10, 2);
     $this->update_post();
 }
 function __construct($atts)
 {
     global $editpost, $group_id, $rcl_options, $user_ID, $formData;
     $editpost = false;
     $this->can_edit = true;
     extract(shortcode_atts(array('cats' => false, 'id' => 1, 'id_upload' => 'upload-public-form', 'accept' => 'image/*', 'post_type' => 'post', 'type_editor' => null, 'wp_editor' => null, 'group_id' => $group_id), $atts));
     $this->post_type = $post_type;
     $this->id_upload = $id_upload;
     $this->terms = $cats;
     $this->form_id = $id;
     $this->accept = $accept;
     if (!isset($wp_editor)) {
         if (isset($rcl_options['wp_editor'])) {
             $cnt = count($rcl_options['wp_editor']);
             if ($cnt == 1) {
                 $type = $rcl_options['wp_editor'][0];
             } else {
                 $type = 3;
             }
         }
         $this->wp_editor = isset($type) ? $type : 0;
     } else {
         $this->wp_editor = $wp_editor;
     }
     $this->type_editor = $type_editor;
     if (!isset($this->type_editor)) {
         $this->type_editor = isset($rcl_options['type_editor-' . $this->post_type]) ? $rcl_options['type_editor-' . $this->post_type] : $rcl_options['type_text_editor'];
     }
     if (isset($_GET['rcl-post-edit'])) {
         $this->post_id = $_GET['rcl-post-edit'];
         $editpost = get_post($this->post_id);
         $this->post_type = $editpost->post_type;
         if ($this->post_type == 'post-group') {
             if (!rcl_can_user_edit_post_group($this->post_id) && !current_user_can('edit_post', $this->post_id)) {
                 $this->can_edit = false;
             }
             $group_id = rcl_get_group_id_by_post($this->post_id);
             $widget_options = rcl_get_group_option($group_id, 'widgets_options');
             if (isset($widget_options['group-public-form-widget'])) {
                 $this->type_editor = $widget_options['group-public-form-widget']['type_form'];
             }
         } else {
             if (!current_user_can('edit_post', $this->post_id)) {
                 $this->can_edit = false;
             }
         }
         $form_id = get_post_meta($this->post_id, 'publicform-id', 1);
         if ($form_id) {
             $this->form_id = $form_id;
         }
     }
     $taxs = array();
     $taxs = apply_filters('taxonomy_public_form_rcl', $taxs);
     if (isset($rcl_options['accept-' . $this->post_type])) {
         $this->accept = $rcl_options['accept-' . $this->post_type];
     }
     $formData = (object) array('form_id' => $this->form_id, 'post_id' => $this->post_id, 'post_type' => $this->post_type, 'id_upload' => $this->id_upload, 'terms' => $this->terms, 'accept' => $this->accept, 'type_editor' => $this->type_editor, 'wp_editor' => $this->wp_editor, 'taxonomy' => $taxs);
     if ($this->user_can()) {
         rcl_fileapi_scripts();
         rcl_fileupload_scripts();
     }
     if ($this->post_id) {
         add_filter('after_public_form_rcl', array(&$this, 'delete_button'), 10, 2);
     }
 }