Example #1
2
 /**
  * Constructor for the Anthologize class
  *
  * This constructor does the following:
  * - Checks minimum PHP and WP version, and bails if they're not met
  * - Includes Anthologize's main files
  * - Sets up the basic hooks that initialize Anthologize's post types and UI
  *
  * @since 0.7
  */
 public function __construct()
 {
     // Bail if PHP version is not at least 5.0
     if (!self::check_minimum_php()) {
         add_action('admin_notices', array('Anthologize', 'phpversion_nag'));
         return;
     }
     // Bail if WP version is not at least 3.3
     if (!self::check_minimum_wp()) {
         add_action('admin_notices', array('Anthologize', 'wpversion_nag'));
     }
     // If we've made it this far, start initializing Anthologize
     register_activation_hook(__FILE__, array($this, 'activation'));
     register_deactivation_hook(__FILE__, array($this, 'deactivation'));
     // @todo WP's functions plugin_basename() etc don't work
     //   correctly on symlinked setups, so I'm implementing my own
     $bn = explode(DIRECTORY_SEPARATOR, dirname(__FILE__));
     $this->basename = array_pop($bn);
     $this->plugin_dir = plugin_dir_path(__FILE__);
     $this->plugin_url = plugin_dir_url(__FILE__);
     $this->includes_dir = trailingslashit($this->plugin_dir . 'includes');
     $upload_dir = wp_upload_dir();
     $this->cache_dir = trailingslashit($upload_dir['basedir'] . '/anthologize-cache');
     $this->cache_url = trailingslashit($upload_dir['baseurl'] . '/anthologize-cache');
     $this->setup_constants();
     $this->includes();
     $this->setup_hooks();
 }
Example #2
1
 function cherry_plugin_settings()
 {
     global $wpdb;
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $upload_dir = wp_upload_dir();
     $plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
     //Cherry plugin constant variables
     define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
     define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
     define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
     define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
     define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
     define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
     define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
     define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
     define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
     //Other constant variables
     define('CURRENT_THEME_DIR', get_stylesheet_directory());
     define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
     define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
     define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
     // if ( !defined('API_URL') ) {
     // 	define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
     // }
     load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
     do_action('cherry_plugin_settings');
 }
 public function __construct()
 {
     $plugin_dir = plugin_dir_url(__FILE__);
     global $woocommerce;
     $this->id = 'twocheckoutpp';
     $this->icon = apply_filters('woocommerce_twocheckoutpp_icon', '' . $plugin_dir . 'paypal.png');
     $this->has_fields = true;
     // Load the settings
     $this->init_form_fields();
     $this->init_settings();
     // Define user set variables
     $this->title = $this->get_option('title');
     $this->seller_id = $this->get_option('seller_id');
     $this->secret_word = $this->get_option('secret_word');
     $this->description = $this->get_option('description');
     $this->notify_url = str_replace('https:', 'http:', add_query_arg('wc-api', 'WC_Gateway_Twocheckoutpp', home_url('/')));
     $this->debug = $this->get_option('debug');
     self::$log_enabled = $this->debug;
     // Actions
     add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page'));
     // Save options
     add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
     // Payment listener/API hook
     add_action('woocommerce_api_wc_gateway_twocheckoutpp', array($this, 'check_ipn_response'));
     if (!$this->is_valid_for_use()) {
         $this->enabled = false;
     }
 }
Example #4
0
 function __construct()
 {
     if (!defined('PREMISE_VERSION')) {
         define('PREMISE_VERSION', '2.2.1');
         define('PREMISE_SETTINGS_FIELD', $this->_metakey_Settings);
         define('PREMISE_DIR', plugin_dir_path(__FILE__));
         define('PREMISE_URL', plugin_dir_url(__FILE__));
         define('PREMISE_BASENAME', plugin_basename(__FILE__));
         define('PREMISE_LIB_DIR', PREMISE_DIR . 'lib/');
         define('PREMISE_THEMES_DIR', PREMISE_DIR . 'themes/');
         define('PREMISE_THEMES_URL', PREMISE_URL . 'themes/');
         define('PREMISE_VIEWS_DIR', PREMISE_DIR . 'views/');
         define('PREMISE_RESOURCES_URL', PREMISE_URL . 'resources/');
         define('PREMISE_POST_TYPE', 'landing_page');
         define('PREMISE_MEMBER_DIR', PREMISE_DIR . 'member-access/');
         define('PREMISE_MEMBER_INCLUDES_DIR', PREMISE_MEMBER_DIR . 'includes/');
     }
     $settings = $this->get_settings();
     if (!empty($settings['main']['member-access']) && '1' == $settings['main']['member-access']) {
         require_once PREMISE_LIB_DIR . 'functions.php';
         require_once PREMISE_LIB_DIR . 'class-admin.php';
         require_once PREMISE_MEMBER_DIR . 'member-access.php';
     }
     $this->_use_premise_theme = empty($settings['main']['theme-support']) || $settings['main']['theme-support'] != '1';
     add_filter('generate_rewrite_rules', array($this, 'generate_rewrite_rules'));
     add_action('setup_theme', array($this, 'register_post_type'));
     if (!is_admin()) {
         add_action('setup_theme', array($this, 'setup_theme'), 11);
     }
     add_action('init', array($this, 'init'));
     add_action('update_option_' . $this->_option_DesignSettings, array($this, 'create_stylesheets'), 11, 2);
     add_filter('post_type_link', array($this, 'post_type_link'), 10, 3);
     load_plugin_textdomain('premise', false, '/premise/languages/');
 }
Example #5
0
/**
 * List of JavaScript / CSS files for admin
 */
function owl_carousel_admin_register_scripts()
{
    wp_register_style('owl.carousel.admin.styles', plugin_dir_url(__FILE__) . 'css/admin_styles.css');
    wp_enqueue_style('owl.carousel.admin.styles');
    wp_register_script('owl.carousel.admin.script', plugin_dir_url(__FILE__) . 'js/admin_script.js');
    wp_enqueue_script('owl.carousel.admin.script');
}
function pmproet_scripts()
{
    if (!empty($_REQUEST['page']) && $_REQUEST['page'] == 'pmpro-email-templates') {
        wp_enqueue_script('pmproet', plugin_dir_url(__FILE__) . 'js/pmproet.js', array('jquery'), null, false);
        wp_enqueue_style('pmproet', plugin_dir_url(__FILE__) . 'css/pmproet.css');
    }
}
Example #7
0
function cf_slack_register_processor($pr)
{
    $pr['slack'] = array("name" => __('Slack: Message', 'cf-slack'), "description" => __("Post a message to slack on submission", 'cf-slack'), "author" => 'David Cramer', "author_url" => 'https://Calderawp.com', "icon" => plugin_dir_url(__FILE__) . "icon.png", "processor" => 'cf_send_slack_message', "template" => plugin_dir_path(__FILE__) . "config.php");
    //@since 1.1.0
    $pr['slack-invite'] = array("name" => __('Slack: Invite', 'cf-slack'), "description" => __("Send a Slack Invite", 'cf-slack'), "author" => 'Josh Pollock', "author_url" => 'https://Calderawp.com', "icon" => plugin_dir_url(__FILE__) . "icon.png", "processor" => 'cf_slack_send_invite', "template" => plugin_dir_path(__FILE__) . "config-invite.php");
    return $pr;
}
Example #8
0
 /**
  * Register the stylesheets for the public-facing side of the site.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts()
 {
     /**
      * 
      */
     wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/wvas-public.js', array('jquery'), $this->version, false);
 }
 function enqueue_frontend_scripts($instance)
 {
     if (!empty($instance['trigger'])) {
         wp_enqueue_script('waypoints', plugin_dir_url(LRW_BASE_FILE) . 'inc/assets/js/waypoints.min.js', array('jquery'), LRW_BUNDLE_VERSION);
     }
     parent::enqueue_frontend_scripts($instance);
 }
 function initialize()
 {
     $this->register_frontend_scripts(array(array('lsow-ytp', LSOW_PLUGIN_URL . 'assets/js/jquery.mb.YTPlayer' . SOW_BUNDLE_JS_SUFFIX . '.js', array('jquery'), LSOW_VERSION)));
     $this->register_frontend_styles(array(array('lsow-hero-image', plugin_dir_url(__FILE__) . 'css/style.css')));
     add_action('wp_enqueue_scripts', array($this, 'init_custom_css'), 15);
     // load as late as possible
 }
 /**
  * Register the stylesheets for the public-facing side of the site.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts()
 {
     wp_enqueue_script($this->plugin_name . "_jquery_cookie", plugin_dir_url(__FILE__) . 'js/vendor/jquery.cookie.js', array('jquery'), $this->version, false);
     wp_register_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/smarter-browser-warning-public.js', array('jquery'), $this->version, false);
     wp_localize_script($this->plugin_name, 'sbw_globals', $this->get_js_globals());
     wp_enqueue_script($this->plugin_name);
 }
 public function get_plugin_url()
 {
     if ($this->plugin_url) {
         return $this->plugin_url;
     }
     return $this->plugin_url = plugin_dir_url(__FILE__);
 }
Example #13
0
function myplugin_scripts()
{
    wp_register_style('jQuery-UI-style', plugin_dir_url(__FILE__) . 'css/jquery-ui-black-tie.css');
    wp_enqueue_style('jQuery-UI-style');
    wp_register_style('MB-style', plugin_dir_url(__FILE__) . 'css/style.css');
    wp_enqueue_style('MB-style');
}
Example #14
0
 /**
  * Properly set the Kirki URL for assets.
  * Determines if Kirki is installed as a plugin, in a child theme, or a parent theme
  * and then does some calculations to get the proper URL for its CSS & JS assets.
  */
 public function set_url()
 {
     // The path of the Kirki's parent-folder.
     $path = wp_normalize_path(dirname(Kirki::$path));
     // Get parent-theme path.
     $parent_theme_path = get_template_directory();
     $parent_theme_path = wp_normalize_path($parent_theme_path);
     // Get child-theme path.
     $child_theme_path = get_stylesheet_directory_uri();
     $child_theme_path = wp_normalize_path($child_theme_path);
     Kirki::$url = plugin_dir_url(dirname(__FILE__) . 'kirki.php');
     // Is Kirki included in a parent theme?
     if (false !== strpos(Kirki::$path, $parent_theme_path)) {
         Kirki::$url = get_template_directory_uri() . str_replace($parent_theme_path, '', Kirki::$path);
     }
     // Is there a child-theme?
     if ($child_theme_path !== $parent_theme_path) {
         // Is Kirki included in a child theme?
         if (false !== strpos(Kirki::$path, $child_theme_path)) {
             Kirki::$url = get_template_directory_uri() . str_replace($child_theme_path, '', Kirki::$path);
         }
     }
     // Apply the kirki/config filter.
     $config = apply_filters('kirki/config', array());
     if (isset($config['url_path'])) {
         Kirki::$url = esc_url_raw($config['url_path']);
     }
 }
Example #15
0
 function input_admin_enqueue_scripts()
 {
     $dir = plugin_dir_url(__FILE__);
     // register & include JS
     wp_register_script('acf-input-twoway', "{$dir}2way.js");
     wp_enqueue_script('acf-input-twoway');
 }
Example #16
0
 public function __construct()
 {
     global $wpdb;
     $this->_fwork = 'plulz';
     $this->_share = get_option($this->_fwork);
     $this->_shareList = array('Brindes', 'Brindes Personalizados');
     $this->group = 'facebook_group';
     $this->name = 'fbseocomments';
     $this->table = $wpdb->prefix . 'comments_fbseo';
     $this->pluginAdminPage = admin_url('admin.php') . '?page=' . $this->name;
     $this->action = admin_url('options.php');
     $this->options = get_option($this->name);
     $this->wordpressLink = 'seo-facebook-comments';
     $this->adminStylesheet = array('filedir' => PLULZ_SEOFB_PLUGIN_ASSETS, 'name' => $this->name . 'Stylesheet');
     $this->menuPage = array('page_title' => 'SEO Facebook Comments', 'menu_title' => 'SEO Facebook', 'capability' => 'administrator', 'menu_slug' => $this->name, 'icon_url' => plugin_dir_url(__FILE__) . 'assets/tiny-logo-plulz.png', 'position' => '', 'submenus' => array());
     // @ref http://codex.wordpress.org/Function_Reference/add_action
     add_action('wp_print_styles', array(&$this, 'addFbStyles'));
     // og tags
     add_action('wp_head', array(&$this, 'fbOpenGraph'));
     // og tag
     // fbLanguages
     add_action('language_attributes', array(&$this, 'fbLanguages'));
     // comments
     add_filter('comments_array', array(&$this, 'FbComments'));
     // share
     add_action('wp_footer', array(&$this, 'share'));
     register_activation_hook(__FILE__, array(&$this, 'install'));
     register_deactivation_hook(__FILE__, array(&$this, 'remove'));
     register_uninstall_hook(__FILE__, array(&$this, 'remove'));
     parent::__construct();
 }
Example #17
0
 function __construct($wpdb, $wp_plugin_dir, $downloader)
 {
     $this->db = $wpdb;
     $this->plugin_path = $wp_plugin_dir;
     $this->plugin_url = plugin_dir_url(__FILE__);
     $this->downloader = $downloader;
 }
Example #18
0
function r_bopenlearn_menu()
{
    add_menu_page('B Open Learn', 'B Open Learn', 'manage_options', __FILE__, 'r_bopenlearn_overview', plugin_dir_url(__FILE__) . '/images/icon.png');
    add_submenu_page(__FILE__, 'Subject Suggestion', 'Subject Suggestion', 'manage_options', __FILE__ . '_suggestion', 'r_bopenlearn');
    add_submenu_page(__FILE__, 'New Post Suggestion', 'New Post Suggestion', 'manage_options', __FILE__ . '_newpost', 'r_newpost');
    add_submenu_page(__FILE__, 'Course Tracker', 'Course Tracker', 'manage_options', __FILE__ . '_ctrack', 'r_ctrack');
}
 public function enqueue()
 {
     wp_enqueue_script('advanced_css_editor_codemirror_js', plugin_dir_url(__FILE__) . 'js/codemirror.js', array('jquery'), '', true);
     wp_enqueue_script('advanced_css_editor_css_js', plugin_dir_url(__FILE__) . 'js/css.js', array('advanced_css_editor_codemirror_js'), '', true);
     wp_enqueue_script('advanced_css_editor_custom_js', plugin_dir_url(__FILE__) . 'js/code-control.js', array('advanced_css_editor_codemirror_js'), '', true);
     wp_enqueue_style('advanced_css_editor_codemirror_css', plugin_dir_url(__FILE__) . 'css/codemirror.css', NULL, NULL, 'all');
 }
 /**
  * Boots the Helper.
  */
 public static function boot()
 {
     self::$base = plugin_directory();
     self::$base = self::$base . '/' . basename(plugin_dir_url(__DIR__)) . '/';
     self::$config = @(require self::$base . '/herbert.config.php');
     self::$booted = true;
 }
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $title = $instance["title"] ? $instance["title"] : "Slick About";
        $body = $instance["body"] ? $instance["body"] : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean non sodales metus. Curabitur eros nulla, facilisis tincidunt laoreet sit amet, tristique at sem. Vestibulum scelerisque nunc ac leo viverra lobortis. In congue eleifend nulla id dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam euismod odio quis lectus consectetur scelerisque. Nam non erat eget nisl tincidunt volutpat. Nulla et ex quis ex ultrices cursus eu et augue.";
        $image = $instance["image"] ? $instance["image"] : plugin_dir_url(__FILE__) . 'profile.png';
        $ctaText = $instance["ctaText"] ? $instance["ctaText"] : "Learn More";
        $ctaLink = $instance["ctaLink"] ? $instance["ctaLink"] : "#";
        $ctaColour = $instance["ctaColour"] ? $instance["ctaColour"] : "#3498db";
        echo $before_widget;
        ?>
            <img src="<?php 
        echo $image;
        ?>
"/>
            <?php 
        echo $before_title . $title . $after_title;
        ?>
            <p class="body"><?php 
        echo $body;
        ?>
</p>
            <a href="<?php 
        echo $ctaLink;
        ?>
"><button class="cta" style="background: <?php 
        echo $ctaColour;
        ?>
;"><?php 
        echo $ctaText;
        ?>
</button></a>
        <?php 
        echo $after_widget;
    }
 /**
  * put your comment there...
  * 
  * @param mixed $file
  * @param mixed $config
  */
 protected function __construct($file, $config)
 {
     $this->file = $file;
     $this->dir = dirname($file);
     $this->url = plugin_dir_url($file);
     $this->config = $config;
 }
 /**
  * Register the stylesheets for the public-facing side of the site.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts()
 {
     global $post, $product;
     if (is_object($post) && class_exists('WooCommerce')) {
         $is_product_type_variable = 'false';
         if (function_exists('wc_get_product')) {
             $product = wc_get_product($post);
             if ($product) {
                 if ($product->is_type('variable') && is_single()) {
                     $is_product_type_variable = 'true';
                 }
             }
         }
         $attach_id = isset($_SESSION['attach_id']) && !empty($_SESSION['attach_id']) ? $_SESSION['attach_id'] : '';
         if (!empty($attach_id)) {
             $total_word = get_post_meta($attach_id, 'total_word', true);
         } else {
             $total_word = '';
         }
         if (!empty($attach_id)) {
             $total_character = get_post_meta($attach_id, 'total_character', true);
         } else {
             $total_character = '';
         }
         wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-public.js', array('jquery'), $this->version, false);
         if (wp_script_is($this->plugin_name)) {
             wp_localize_script($this->plugin_name, 'woocommerce_price_per_word_params', apply_filters('woocommerce_price_per_word_params', array('ajax_url' => admin_url('admin-ajax.php'), 'woocommerce_price_per_word_params_nonce' => wp_create_nonce("woocommerce_price_per_word_params_nonce"), 'total_word' => $total_word, 'total_character' => $total_character, 'is_product_type_variable' => $is_product_type_variable, 'woocommerce_currency_symbol_js' => get_woocommerce_currency_symbol(), 'woocommerce_price_num_decimals' => wc_get_price_decimals(), 'aewcppw_word_character' => $this->wppw_get_product_type(), 'aewcppw_allow_users_to_enter_qty' => $this->aewcppw_allow_users_to_enter_qty())));
         }
         wp_enqueue_script($this->plugin_name . '-bn', plugin_dir_url(__FILE__) . 'js/woocommerce-price-per-word-bn.js', array('jquery'), $this->version, false);
     }
 }
 function __construct()
 {
     // If we're in the admin area, load the settings class
     if (is_admin()) {
         require dirname(__FILE__) . '/settings.php';
         $settingsClass = new LazyLoadXTSettings();
         // If this is the first time we've enabled the plugin, setup default settings
         register_activation_hook(__FILE__, array($settingsClass, 'first_time_activation'));
         add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($settingsClass, 'lazyloadxt_action_links'));
     } else {
         // Store our settings in memory to reduce mysql calls
         $this->settings = $this->get_settings();
         $this->dir = plugin_dir_url(__FILE__);
         // The CDN has an older version
         if ($this->settings['cdn']) {
             $this->lazyloadxt_ver = '1.0.5';
         }
         // Enqueue Lazy Load XT scripts and styles
         add_action('wp_enqueue_scripts', array($this, 'load_scripts'));
         // Replace the 'src' attr with 'data-src' in the_content
         add_filter('the_content', array($this, 'filter_html'));
         // If enabled replace the 'src' attr with 'data-src' in text widgets
         if ($this->settings['textwidgets']) {
             add_filter('widget_text', array($this, 'filter_html'));
         }
         // If enabled replace the 'src' attr with 'data-src' in the_post_thumbnail
         if ($this->settings['thumbnails']) {
             add_filter('post_thumbnail_html', array($this, 'filter_html'));
         }
         // If enabled replace the 'src' attr with 'data-src' in the_post_thumbnail
         if ($this->settings['avatars']) {
             add_filter('get_avatar', array($this, 'filter_html'));
         }
     }
 }
Example #25
0
function yith_magnifier_constructor()
{
    global $woocommerce;
    if (!isset($woocommerce)) {
        return;
    }
    /**
     * Required functions
     */
    if (!defined('YITH_FUNCTIONS')) {
        require_once 'yit-common/yit-functions.php';
    }
    load_plugin_textdomain('yit', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    define('YITH_WCMG', true);
    define('YITH_WCMG_URL', plugin_dir_url(__FILE__));
    define('YITH_WCMG_DIR', plugin_dir_path(__FILE__));
    // Load required classes and functions
    require_once 'functions.yith-wcmg.php';
    require_once 'class.yith-wcmg-admin.php';
    require_once 'class.yith-wcmg-frontend.php';
    require_once 'class.yith-wcmg.php';
    // Let's start the game!
    global $yith_wcmg;
    $yith_wcmg = new YITH_WCMG();
}
Example #26
0
 /**
  * Bootstrap constants.
  *
  */
 private function constants()
 {
     // define plugin translation string
     if (!defined('BP_API_PLUGIN_SLUG')) {
         define('BP_API_PLUGIN_SLUG', 'bp_api');
     }
     // define api endpint prefix
     if (!defined('BP_API_SLUG')) {
         define('BP_API_SLUG', 'bp');
     }
     // Define a constant that can be checked to see if the component is installed or not.
     if (!defined('BP_API_IS_INSTALLED')) {
         define('BP_API_IS_INSTALLED', 1);
     }
     // Define a constant that will hold the current version number of the component
     // This can be useful if you need to run update scripts or do compatibility checks in the future
     if (!defined('BP_API_VERSION')) {
         define('BP_API_VERSION', '0.1');
     }
     // Define a constant that we can use to construct file paths and url
     if (!defined('BP_API_PLUGIN_DIR')) {
         define('BP_API_PLUGIN_DIR', trailingslashit(plugin_dir_path(__FILE__)));
     }
     if (!defined('BP_API_PLUGIN_URL')) {
         $plugin_url = plugin_dir_url(__FILE__);
         // If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
         if (is_ssl()) {
             $plugin_url = str_replace('http://', 'https://', $plugin_url);
         }
         define('BP_API_PLUGIN_URL', $plugin_url);
     }
 }
Example #27
0
/**
 * Add styles and scripts
 * @return (void)
 */
function han_dwa_qa_add_styles_scripts()
{
    wp_enqueue_style('dashicons');
    wp_enqueue_style('han_dwa_qa_styles', plugin_dir_url(__FILE__) . 'assets/css/han_dwa_qa_styles.css', null, '1.0.0');
    wp_enqueue_script('han_dwa_qa_scripts', plugin_dir_url(__FILE__) . 'assets/js/han_dwa_qa_scripts.js', array('jquery'), '1.0.0');
    wp_localize_script('han_dwa_qa_scripts', 'han_dwa_qa_ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
}
 /**
  * Class contructor
  *
  * @since   0.2
  **/
 public function __construct()
 {
     // activation ##
     register_activation_hook(__FILE__, array($this, 'register_activation_hook'));
     // deactivation ##
     register_deactivation_hook(__FILE__, array($this, 'register_deactivation_hook'));
     // uninstall ##
     // TODO ##
     // load in mobile detect class ##
     if (!class_exists('Mobile_Detect')) {
         include Q_BROWSERS_PATH . '/library/mobile_detect.php';
     }
     // instatiate class ##
     $this->detect = new Mobile_Detect();
     $this->detect->setDetectionType('extended');
     // extended search ##
     // grab user agent ##
     $this->useragent = $_SERVER['HTTP_USER_AGENT'] ? $_SERVER['HTTP_USER_AGENT'] : false;
     if (is_admin()) {
         // text-domain ##
         add_action('plugins_loaded', array($this, 'load_plugin_textdomain'), 1);
         // plugin URL ##
         $this->plugin_URL = WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__));
         $this->plugin_dir_path = plugin_dir_url(__FILE__);
     } else {
         // conditional stylesheets for browser tweaks ##
         add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_conditional'), 10000000);
         // load them late ##
         // browser body_class ##
         add_filter('body_class', array($this, 'body_classes'), 1);
         // comments ##
         add_action('wp_footer', array($this, 'comments'), 1000);
     }
 }
function wr2x_manage_media_custom_column($column_name, $id)
{
    if ($column_name != 'Retina') {
        return;
    }
    if (wr2x_is_ignore($id)) {
        echo "<img style='margin-top: -2px; margin-bottom: 2px; width: 16px; height: 16px;' src='" . plugin_dir_url(__FILE__) . "img/tick-circle.png' />";
        return;
    }
    // Check if the attachment is an image
    $meta = wp_get_attachment_metadata($id);
    if (!wr2x_is_image_meta($meta)) {
        return "";
    }
    $isAlright = true;
    $info = wr2x_retina_info($id);
    foreach ($info as $name => $attr) {
        if ($attr == 'PENDING' || is_array($attr)) {
            $isAlright = false;
        }
    }
    // Displays the result
    echo "<p id='wr2x_attachment_{$id}' style='margin-bottom: 2px;'>";
    if ($isAlright) {
        echo "<img style='margin-top: -2px; margin-bottom: 2px; width: 16px; height: 16px;' src='" . plugin_dir_url(__FILE__) . "img/tick-circle.png' />";
    } else {
        echo "<a href='upload.php?page=wp-retina-2x'><img style='margin-top: -2px; margin-bottom: 2px; width: 16px; height: 16px;' src='" . plugin_dir_url(__FILE__) . "img/exclamation.png' /></a>";
    }
    echo "</p>";
}
Example #30
-1
 function __construct()
 {
     $this->the_path = plugin_dir_path(__FILE__);
     $this->the_url = plugin_dir_url(__FILE__);
     $this->icon_size = get_option('msdsocial_icon_size') ? get_option('msdsocial_icon_size') : '0';
     $this->ver = '0.9.6';
     /*
      * Pull in some stuff from other files
      */
     //$this->requireDir($this->the_path . 'lib/inc');
     require_once $this->the_path . 'lib/inc/settings.php';
     require_once $this->the_path . 'lib/inc/widgets.php';
     if (!is_admin()) {
         wp_enqueue_style('msd-social-style', $this->the_url . 'lib/css/style.css');
         wp_enqueue_style('msd-social-style-' . $this->icon_size, $this->the_url . 'lib/css/style' . $this->icon_size . '.css');
         wp_enqueue_style('font-awesome-style', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css');
     }
     add_action('admin_enqueue_scripts', array(&$this, 'add_admin_scripts'));
     add_action('admin_enqueue_scripts', array(&$this, 'add_admin_styles'));
     add_action('wp_head', array(&$this, 'setup_notification_bar'));
     add_shortcode('msd-address', array(&$this, 'get_address'));
     add_shortcode('msd-additional-locations', array(&$this, 'get_additional_locations'));
     add_shortcode('msd-all-locations', array(&$this, 'get_all_locations'));
     add_shortcode('msd-bizname', array(&$this, 'get_bizname'));
     add_shortcode('msd-copyright', array(&$this, 'get_copyright'));
     add_shortcode('msd-digits', array(&$this, 'get_digits'));
     add_shortcode('msd-social', array(&$this, 'social_media'));
     add_shortcode('msd-hours', array(&$this, 'get_hours'));
 }