/** * Loads the GDrive JS on the "Users > My Profile" admin page. */ function mexp_gdrive_admin_user_profile_load_js($hook = '') { if ('profile.php' !== $hook) { return; } Media_Explorer::init()->services['gdrive']->enqueue_statics(); }
/** * Loads our JS and markup on a user's BP settings page. */ function mexp_gdrive_bp_settings_loader() { if (false === bp_is_user_settings_general()) { return; } // load our needed JS add_action('wp_enqueue_scripts', array(Media_Explorer::init()->services['gdrive'], 'enqueue_statics')); // add markup on "Settings > General" page add_action('bp_core_general_settings_after_submit', 'mexp_gdrive_bp_user_settings_content', 0); }
public function enqueue_statics() { $mexp = Media_Explorer::init(); wp_enqueue_script('google-jsapi', 'https://www.google.com/jsapi', array(), false); wp_enqueue_script('mexp-service-twitter', $mexp->plugin_url('services/twitter/js.js'), array('jquery', 'mexp'), $mexp->plugin_ver('services/twitter/js.js')); }
public function enqueue_statics() { $mexp = Media_Explorer::init(); wp_enqueue_script('mexp-service-youtube', $mexp->plugin_url('services/youtube/js.js'), array('jquery', 'mexp'), $mexp->plugin_ver('services/youtube/js.js'), true); }
public function enqueue_statics() { $mexp = Media_Explorer::init(); wp_enqueue_script('mexp-service-instagram', $mexp->plugin_url('services/instagram/js.js'), array('jquery', 'mexp'), $mexp->plugin_ver('services/instagram/js.js')); wp_enqueue_style('mexp-service-instagram-css', $mexp->plugin_url('services/instagram/style.css'), array(), $mexp->plugin_ver('services/instagram/style.css')); }
<?php /* Plugin Name: Media Explorer Description: Extends the Media Manager to add support for external media services (currently Twitter, YouTube, and Instagram). Version: 1.2 Author: Code For The People Ltd, Automattic Text Domain: mexp Domain Path: /languages/ License: GPL v2 or later This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ defined('ABSPATH') or die; foreach (array('plugin', 'mexp', 'service', 'template', 'response') as $class) { require_once sprintf('%s/class.%s.php', dirname(__FILE__), $class); } foreach (glob(dirname(__FILE__) . '/services/*/service.php') as $service) { include $service; } Media_Explorer::init(__FILE__);