/** * @param string $plugin_file_path * @param Amazon_Web_Services $aws * @param string|null $slug */ function __construct($plugin_file_path, $aws, $slug = null) { $this->plugin_slug = is_null($slug) ? 'amazon-s3-and-cloudfront' : $slug; parent::__construct($plugin_file_path); $this->aws = $aws; $this->init($plugin_file_path); }
function __construct($plugin_file_path, $aws) { $this->plugin_title = __('WP AWS Zencoder', 'waz'); $this->plugin_menu_title = __('Zencoder', 'waz'); $this->plugin_slug = 'wp-aws-zencoder'; // lets do this before anything else gets loaded $this->require_zencoder(); parent::__construct($plugin_file_path); $this->aws = $aws; $this->zen = new Services_Zencoder($this->get_api_key()); // Admin add_action('aws_admin_menu', array($this, 'admin_menu')); // Whenever a post is saved, check if any attached media should be encoded add_action('save_post', array($this, 'save_post'), 1000); add_action('edit_post', array($this, 'save_post'), 1000); add_action('publish_post', array($this, 'save_post'), 1000); add_action('maj_post_attached_to_media', array($this, 'save_post'), 1000); add_action('maj_video_updated', array($this, 'save_post'), 1000); // When student media uploader videos are uploaded, encode them add_filter('maj_media_import', [$this, 'student_media_uploader_send_for_encoding'], 1000); // Let's delete the attachments add_filter('delete_attachment', array($this, 'delete_attachment'), 20); // Rewrites add_action('wp_loaded', array($this, 'flush_rules')); add_filter('rewrite_rules_array', array($this, 'rewrite_rules')); add_filter('query_vars', array($this, 'query_vars')); // Catch notifications from zencoder add_action('pre_get_posts', array($this, 'zencoder_notification')); }
/** * @param string $plugin_file_path * @param Amazon_Web_Services $aws * @param string|null $slug */ function __construct($plugin_file_path, $aws, $slug = null) { $this->plugin_slug = is_null($slug) ? 'amazon-s3-and-cloudfront' : $slug; parent::__construct($plugin_file_path); $this->aws = $aws; $this->notices = AS3CF_Notices::get_instance($this, $plugin_file_path); $this->init($plugin_file_path); }
function __construct($plugin_file_path, $aws) { parent::__construct($plugin_file_path); $this->aws = $aws; add_action('aws_admin_menu', array($this, 'admin_menu')); $this->plugin_title = __('Amazon S3 and CloudFront', 'as3cf'); $this->plugin_menu_title = __('S3 and CloudFront', 'as3cf'); add_action('wp_ajax_as3cf-create-bucket', array($this, 'ajax_create_bucket')); add_filter('wp_get_attachment_url', array($this, 'wp_get_attachment_url'), 9, 2); add_filter('wp_generate_attachment_metadata', array($this, 'wp_generate_attachment_metadata'), 20, 2); add_filter('delete_attachment', array($this, 'delete_attachment'), 20); }
function __construct($plugin_file_path) { parent::__construct($plugin_file_path); do_action('aws_init', $this); if (is_admin()) { do_action('aws_admin_init', $this); } if (is_multisite()) { add_action('network_admin_menu', array($this, 'admin_menu')); $this->plugin_permission = 'manage_network_options'; } else { add_action('admin_menu', array($this, 'admin_menu')); $this->plugin_permission = 'manage_options'; } $this->plugin_title = __('Amazon Web Services', 'amazon-web-services'); $this->plugin_menu_title = __('AWS', 'amazon-web-services'); }
function __construct($plugin_file_path) { $this->plugin_slug = 'amazon-web-services'; parent::__construct($plugin_file_path); do_action('aws_init', $this); if (is_admin()) { do_action('aws_admin_init', $this); } if (is_multisite()) { add_action('network_admin_menu', array($this, 'admin_menu')); $this->plugin_permission = 'manage_network_options'; } else { add_action('admin_menu', array($this, 'admin_menu')); $this->plugin_permission = 'manage_options'; } $this->plugin_title = __('Amazon Web Services', 'amazon-web-services'); $this->plugin_menu_title = __('AWS', 'amazon-web-services'); load_plugin_textdomain('amazon-web-services', false, dirname(plugin_basename($plugin_file_path)) . '/languages/'); }
function __construct($plugin_file_path, $aws) { parent::__construct($plugin_file_path); $this->aws = $aws; add_action('aws_admin_menu', array($this, 'admin_menu')); $this->plugin_title = __('Amazon S3 Uploader', 'wp_s3'); $this->plugin_menu_title = __('S3 Uploader', 'wp_s3'); add_action('wp_ajax_wp_s3-create-bucket', array($this, 'ajax_create_bucket')); add_filter('wp_get_attachment_url', array($this, 'wp_get_attachment_url'), 9, 2); //add_filter('wp_generate_attachment_metadata', array($this, 'wp_generate_attachment_metadata'), 20, 2); //add_filter('delete_attachment', array($this, 'delete_attachment'), 20); if (is_admin() && !empty($_FILES) && (!empty($_POST['html-upload']) || $_SERVER['REQUEST_URI'] == '/wp-admin/async-upload.php')) { $file = $_FILES['async-upload']; if (!is_array($file_info = $this->file_info($file))) { die('That file is not allowed: ' . $file_info . '. Hit back to try again.'); } $upload = $this->file_upload($file_info, intval($_POST['post_id'])); if ($_POST['action'] == 'upload-attachment') { $data = wp_prepare_attachment_for_js($upload['id']); if (substr($data['url'], 0, 5) == '/tmp/') { $data['url'] = $upload['file']; } if (substr($data['url'], 0, 2) == '//') { $data['url'] = 'http:' . $data['url']; } foreach ($upload['sizes'] as $key => $info) { $data['sizes'][$key]['url'] = $upload['prefix'] . $info['file']; } $data['sizes']['full']['url'] = $data['url']; die(json_encode(array('success' => true, 'data' => $data))); } if (empty($_POST['html-upload'])) { die('' . $data['id']); } header("Location: upload.php"); die(''); } }