| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* GmediaProcessor_AddMedia |
| 8 |
*/ |
| 9 |
class GmediaProcessor_AddMedia extends GmediaProcessor { |
| 10 |
|
| 11 |
private static $me = null; |
| 12 |
|
| 13 |
public $import = false; |
| 14 |
public $url; |
| 15 |
|
| 16 |
/** |
| 17 |
* GmediaProcessor_Library constructor. |
| 18 |
*/ |
| 19 |
public function __construct() { |
| 20 |
parent::__construct(); |
| 21 |
|
| 22 |
global $gmCore; |
| 23 |
|
| 24 |
$this->import = $gmCore->_get( 'import', false, true ); |
| 25 |
$this->url = add_query_arg( array( 'import' => $this->import ), $this->url ); |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
public static function getMe() { |
| 30 |
if ( null === self::$me ) { |
| 31 |
self::$me = new GmediaProcessor_AddMedia(); |
| 32 |
} |
| 33 |
|
| 34 |
return self::$me; |
| 35 |
} |
| 36 |
|
| 37 |
protected function processor() { |
| 38 |
global $gmCore; |
| 39 |
|
| 40 |
if ( ! $gmCore->caps['gmedia_upload'] ) { |
| 41 |
wp_die( esc_html__( 'You are not allowed to be here', 'grand-media' ) ); |
| 42 |
} |
| 43 |
|
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
global $gmProcessorAddMedia; |
| 48 |
$gmProcessorAddMedia = GmediaProcessor_AddMedia::getMe(); |
| 49 |
|