Skip to content

Commit

Permalink
add external uri support
Browse files Browse the repository at this point in the history
added external uri support (e.g. jquery cdn)
  • Loading branch information
kking124 authored Nov 1, 2017
1 parent 0d1c85d commit e98b8b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wpenq-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,13 @@ public static function isset_array($array, $index, $default = array()) {
* @return string Full asset URL
*/
public static function get_full_url($value) {
if((bool) preg_match("/^https?:\/\/.*$/xi", $value)) {
return $value;
}
if (mb_stripos($value, 'custom') === 0) {
return self::$plugin_url . 'assets/' . $value;
} else {
return self::$theme_url . $value;
}
return self::$theme_url . $value;
}

public static function set_default_scripts($scripts) {
Expand Down Expand Up @@ -146,4 +148,4 @@ function plugin_assets($hook) {
wp_enqueue_script('editable-select-js', $url . 'assets/plugin/jquery.editable-select.min.js');
}

add_action('admin_enqueue_scripts', 'plugin_assets');
add_action('admin_enqueue_scripts', 'plugin_assets');

0 comments on commit e98b8b5

Please sign in to comment.