<?php /* Plugin Name: SP Random Hello Bar Plugin URI: https://github.com/sitepoint/sp-random-hello-bar Description: Displays a random hello bar after scrolling past an element of the page. Version: 1.0.1 Author: Brad Denver License: GPL2 */ require_once plugin_dir_path(__FILE__) . 'src/SitePoint/RandomHelloBar.php'; \SitePoint\RandomHelloBar::public_actions(); if (is_admin()) { \Sitepoint\RandomHelloBar::admin_actions(); }
public static function enqueuePublicAssets() { $basic_js = \SitePoint\RandomHelloBar::get_option('basic-js'); if (in_array($basic_js, array('basic', 'basicStorge'))) { wp_enqueue_script(self::PLUGIN_NAME . '-basic-script', plugins_url('../../public/js/' . $basic_js . '.js', __FILE__), array('jquery', 'underscore')); wp_localize_script(self::PLUGIN_NAME . '-basic-script', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'))); } if (\SitePoint\RandomHelloBar::get_option('load-css')) { wp_enqueue_style(self::PLUGIN_NAME . '-basic-css', plugins_url('../../public/css/basic.css', __FILE__)); } }
<?php // If uninstall is not called from WordPress, exit if (!defined('WP_UNINSTALL_PLUGIN')) { exit; } require_once plugin_dir_path(__FILE__) . 'src/SitePoint/RandomHelloBar.php'; \SitePoint\RandomHelloBar::uninstall();