Exemplo n.º 1
0
 /**
  * @see parent::delete()	 
  */
 public function delete()
 {
     $this->deletePosts();
     if (!empty($this->options['import_id']) and wp_all_export_is_compatible()) {
         $import = new PMXI_Import_Record();
         $import->getById($this->options['import_id']);
         if (!$import->isEmpty() and $import->parent_import_id == 99999) {
             $import->delete();
         }
     }
     $export_file_path = wp_all_export_get_absolute_path($this->options['filepath']);
     if (@file_exists($export_file_path)) {
         wp_all_export_remove_source($export_file_path);
     }
     if (!empty($this->attch_id)) {
         wp_delete_attachment($this->attch_id, true);
     }
     $wp_uploads = wp_upload_dir();
     $file_for_remote_access = $wp_uploads['basedir'] . DIRECTORY_SEPARATOR . PMXE_Plugin::UPLOADS_DIRECTORY . DIRECTORY_SEPARATOR . md5(PMXE_Plugin::getInstance()->getOption('cron_job_key') . $this->id) . '.' . $this->options['export_to'];
     if (@file_exists($file_for_remote_access)) {
         @unlink($file_for_remote_access);
     }
     return parent::delete();
 }
Exemplo n.º 2
0
 /**
  * Initialize model instance
  * @param array[optional] $data Array of record data to initialize object with
  */
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->setTable(PMXE_Plugin::getInstance()->getTablePrefix() . 'posts');
 }