| 1 |
<?php |
| 2 |
namespace FileBird\Classes\Modules; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
class ModuleUser { |
| 7 |
private $is_enabled; |
| 8 |
private $current_user_id; |
| 9 |
|
| 10 |
public function __construct() { |
| 11 |
$this->is_enabled = $this->isEnabled(); |
| 12 |
$this->current_user_id = get_current_user_id(); |
| 13 |
|
| 14 |
if ( $this->is_enabled ) { |
| 15 |
add_filter( 'fbv_folder_created_by', array( $this, 'fbv_folder_created_by' ) ); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
public function fbv_folder_created_by() { |
| 20 |
return $this->current_user_id; |
| 21 |
} |
| 22 |
|
| 23 |
private function isEnabled() { |
| 24 |
return get_option( 'njt_fbv_folder_per_user', '0' ) === '1'; |
| 25 |
} |
| 26 |
} |