/** * Enqueue plugin script * */ public function print_script() { wp_enqueue_script('repeat', B5F_Multisite_Categories::get_instance()->plugin_url . 'js/msc-repeatable.js', array('jquery-ui-sortable', 'jquery-ui-core', 'jquery')); }
/** * Add new field in /wp-admin/network/site-new.php * has to be done with jQuery * * URI: http://stackoverflow.com/a/10372861/1287812 */ public function new_site_input_field_scripts() { $url = B5F_Multisite_Categories::get_instance()->plugin_url . 'js/msc-dropdown.js'; wp_register_script('b5f_msc', $url); wp_enqueue_script('b5f_msc'); wp_localize_script('b5f_msc', 'b5f', array('dropdown' => B5F_Multisite_Categories::get_instance()->get_dropdown(''))); }
(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. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ # BUSTED! !defined('ABSPATH') and exit("<pre>Hi there! I'm just part of a plugin, <h1>¿what exactly are you looking for?"); # ACTIVATION register_activation_hook(__FILE__, array('B5F_Multisite_Categories', 'on_activation')); # INIT add_action('plugins_loaded', array(B5F_Multisite_Categories::get_instance(), 'plugin_setup')); class B5F_Multisite_Categories { /** * Plugin instance. * * @see get_instance() * @type object */ protected static $instance = NULL; /** * URL to this plugin's directory. * * @type string */ public $plugin_url = '';