Skip to content

Commit

Permalink
Reapply "[ #1079 ] - class to handle uploads"
Browse files Browse the repository at this point in the history
This reverts commit c5a96d6.
  • Loading branch information
razvanaldea89 committed Sep 30, 2024
1 parent fdd7111 commit ae1aa22
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
58 changes: 58 additions & 0 deletions includes/admin/class-modula-gallery-upload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class Modula_Gallery_Upload
*
* Handles the fast gallery creation from uploaded .zip file
* or from a choosen folder with images that reside on the server
*
* @since 2.10.3
*/

class Modula_Gallery_Upload {

/**
* Holds the class object.
*
* @var Modula_Gallery_Upload
*
* @since 2.10.3
*/
public static $instance = null;

/**
* Defines the default directory for the media browser
*
* @var string
*/
public $default_dir = null;

/**
* Class constructor
*
* @since 2.10.3
*/
private function __construct() {
}

/**
* Create an instance of the class
*
* @return Modula_Gallery_Upload
*
* @since 2.10.3
*/
public static function get_instance() {

if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Modula_Gallery_Upload ) ) {
self::$instance = new Modula_Gallery_Upload();
}

return self::$instance;
}
}

Modula_Gallery_Upload::get_instance();
3 changes: 2 additions & 1 deletion includes/class-modula.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ private function load_dependencies() {
require_once MODULA_PATH . 'includes/admin/class-modula-onboarding.php';

require_once MODULA_PATH . 'includes/admin/class-modula-dashboard.php';

// Modula Upload Class.
require_once MODULA_PATH . 'includes/admin/class-modula-gallery-upload.php';
}
}

Expand Down

0 comments on commit ae1aa22

Please sign in to comment.